Re: VS 2005 warning C4996
Alberto Ganesh Barbati wrote:
News Admin ha scritto:
If I call std::copy using my own back inserter...
std::copy(first,past,myBackInserter);
...VS 2005 (sp1) issues a warning, against this line of
code, saying the third parameter may be unsafe.
Is this standard compliant behaviour on the part of
VS 2005?
Standard behaviour is only about errors, not warnings. Any compiler is
allowed to emit whatever warning it wants, this fact doesn't make it
less standard compliant.
The C++ standard talks only about diagnostics, not about errors or
warnings. It's up to the implementation to document what constitutes a
diagnostic. For most compilers, errors and some warnings are
diagnostics. In particular, note that the C++ standard does not require
compilers to refuse to compile ill-formed code. As long as the compiler
issues a diagnostic, the requirements of the standard are satisfied.
--
-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]