मैं एक साधारण सी ++ बूस्ट के साथ इस तरह है:सी ++ बूस्ट: इस चेतावनी का कारण क्या है?
#include <boost/algorithm/string.hpp>
int main()
{
std::string latlonStr = "hello,ergr()()rg(rg)";
boost::find_format_all(latlonStr,boost::token_finder(boost::is_any_of("(,)")),boost::const_formatter(" "));
यह ठीक काम करता है; यह एक ""
के साथ) की प्रत्येक पुनरावृत्ति (बदलता है, हालांकि, मैं इस चेतावनी जब संकलन मिलती है:
मैं MSVC 2008 का उपयोग कर रहा हूँ, 1.37.0 बढ़ावा।
1>Compiling...
1>mainTest.cpp
1>c:\work\minescout-feat-000\extlib\boost\algorithm\string\detail\classification.hpp(102) : 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 (x86)\microsoft visual studio 9.0\vc\include\xutility(2576) : see declaration of 'std::copy'
1> c:\work\minescout-feat-000\extlib\boost\algorithm\string\classification.hpp(206) : see reference to function template instantiation 'boost::algorithm::detail::is_any_ofF<CharT>::is_any_ofF<boost::iterator_range<IteratorT>>(const RangeT &)' being compiled
1> with
1> [
1> CharT=char,
1> IteratorT=const char *,
1> RangeT=boost::iterator_range<const char *>
1> ]
1> c:\work\minescout-feat-000\minescouttest\maintest.cpp(257) : see reference to function template instantiation 'boost::algorithm::detail::is_any_ofF<CharT> boost::algorithm::is_any_of<const char[4]>(RangeT (&))' being compiled
1> with
1> [
1> CharT=char,
1> RangeT=const char [4]
1> ]
मैं निश्चित रूप से चेतावनी
-D_SCL_SECURE_NO_WARNINGS
का उपयोग कर अक्षम कर सकते हैं, लेकिन मैं थोड़ा कि मेरे कोड गलत है, तो इससे पहले कि मैं क्या गलत है, या अधिक महत्वपूर्ण बात यह है यह पता लगाना करने के लिए अनिच्छुक हूँ।
यह चेतावनी मुझे नट्स चलाती है, इसकी एक कॉफी कॉफी की सामग्री के बारे में "चेतावनी" की तरह गर्म होती है। – Clay
इसके बारे में सबसे बुरी चीज यह है कि कोई भी "फिक्स" नहीं है। अधिकांश चेतावनियां जारी की जाती हैं क्योंकि एक ही चीज़ को प्राप्त करने के लिए एक बेहतर, कम त्रुटि-प्रवण तरीका होता है। वे * निश्चित * हो सकते हैं। आपको इस बारे में क्या करना चाहिए? यदि आपके पास कच्ची सी सरणी है और आपको डेटा को प्रतिलिपि बनाने की आवश्यकता है, तो पॉइंटर्स केवल इटरेटर उपलब्ध हैं। std :: प्रतिलिपि अब तक का सबसे सुरक्षित विकल्प उपयोग करने के लिए है। या क्या वे सुझाव दे रहे हैं कि हम एक ही चीज़ को प्राप्त करने के लिए लूप के लिए लिखने के लिए वापस जाएं? – jalf
मैं 100 प्रतिनिधि शर्त लगाता हूं कि इसे पहले एसपी में दूसरे के साथ हटा दिया जाएगा "क्या वे परीक्षण नहीं करते हैं?" मुद्दों ... –