Boost logo

Boost Users :

Subject: [Boost-users] [ublas] warning on VC9 about checked iterators
From: Peter Barker (newbarker_at_[hidden])
Date: 2009-01-25 12:54:49


Hello,

Using Boost 1.37.0, I compile the following program under VC9 (VS .NET
2008 Express Edition):

#include <boost/numeric/ublas/vector.hpp>

class Host
{
public:
        Host(const boost::numeric::ublas::bounded_vector<double,3>& normal) :
normal_(normal) {}
private:
        boost::numeric::ublas::bounded_vector<double,3> normal_;
};

int main()
{
        return 0;
}

and I get the following warning:

1>c:\boost\boost_1_37_0\boost\numeric\ublas\storage.hpp(337) : warning
C4996: 'std::copy': Function call with parameters that may be unsafe -
this call relies on the caller to check that the passed values are
correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See
documentation on how to use Visual C++ 'Checked Iterators'
1> c:\program files\microsoft visual studio
9.0\vc\include\xutility(2576) : see declaration of 'std::copy'
1> c:\boost\boost_1_37_0\boost\numeric\ublas\storage.hpp(334) :
while compiling class template member function
'boost::numeric::ublas::bounded_array<T,N>::bounded_array(const
boost::numeric::ublas::bounded_array<T,N> &)'
1> with
1> [
1> T=double,
1> N=3
1> ]
1> c:\boost\boost_1_37_0\boost\numeric\ublas\vector.hpp(36) :
see reference to class template instantiation
'boost::numeric::ublas::bounded_array<T,N>' being compiled
1> with
1> [
1> T=double,
1> N=3
1> ]
1> c:\boost\boost_1_37_0\boost\numeric\ublas\vector.hpp(524) :
see reference to class template instantiation
'boost::numeric::ublas::vector<T,A>' being compiled
1> with
1> [
1> T=double,
1> A=boost::numeric::ublas::bounded_array<double,3>
1> ]
1> c:\newsystem\readdisplaystlascii\readdisplaystlascii\main.cpp(10)
: see reference to class template instantiation
'boost::numeric::ublas::bounded_vector<T,N>' being compiled
1> with
1> [
1> T=double,
1> N=3
1> ]

Should I compile with -D_SCL_SECURE_NO_WARNINGS? Is there a fix coming
for ublas? What do others do?

Regards,

Pete


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net