470,833 Members | 1,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

VC8 and C4996

So we finally switched a big project to VC8. Good. However,
now I can't see any compiler messages anymore, because they
are burried under gazillions of messages that some C std
functions are declared deprecated. Bad. This code is compiled
on several platforms, so changing it is out of question. Also,
there's several 100kLOC 3rd-party code that we won't touch.

So I've ploughed through the help and played with the macros.
But, despite the fact that the help seems to say that defining
'_CRT_SECURE_NO_DEPRECATE' would disable the warnings, somehow
it doesn't. Did I read the help wrong or is it that I did
something stupid? I am suspicious regarding the latter, but,
if I put a
#define _SECURE_SCL 0
at into the same header, all those warnings disappear. However,
I suspect this also turns off the secure overloads, which we
actually would like to use.
I thought that this
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1
should do the trick, but I still get
iosfwd(582) : warning C4996: 'std::_Traits_helper::copy_s' was declared deprecated
using this.
Is this supposed to happen? Or am I just doing something stupid?

Please enlighten me.

Thanks,

Schobi
P.S.: Here's something I need to get off my chest regarding this:
I have been lobbying for making C++ std compliant project
settings the default at least since when VC7.1 was in beta.
I was told that these things take time, because you don't
want to break your customer's code. (I am glad they are
the default now, BTW.) And now you go ahead and make such
a mess. We get 40,000 new warnings for this project! How
are we supposed to look at this mess? For heaven's sake,
some shops treat warnings as errors!
To say the least: This was a stupid idea.

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"The sarcasm is mightier than the sword."
Eric Jarvis
May 18 '06 #1
3 3250
Hendrik Schober wrote:
I thought that this
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1
should do the trick, but I still get
iosfwd(582) : warning C4996: 'std::_Traits_helper::copy_s' was declared deprecated
using this.


Yes I have the same problem. Try to add _SCL_SECURE_NO_DEPRECATE, as
Igor Tandetnik recommended on microsoft.public.vc.language just hours
ago to a different poster. Please let us know if that helped.

Tom
May 18 '06 #2
Tamas Demjen <td*****@yahoo.com> wrote:
Hendrik Schober wrote:
I thought that this
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1
should do the trick, but I still get
iosfwd(582) : warning C4996: 'std::_Traits_helper::copy_s' was declared deprecated
using this.
Yes I have the same problem. Try to add _SCL_SECURE_NO_DEPRECATE [...]


Indeed, this seems to help. Thanks a lot!
(I am sure I failed to see that '_CRT_SECURE_NO_DEPRECATE'
and '_SCL_SECURE_NO_DEPRECATE' are two different defines
when I stumbled across them somewhere in the help...)
Tom


Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"The sarcasm is mightier than the sword."
Eric Jarvis
May 18 '06 #3
Hendrik Schober <Sp******@gmx.de> wrote:
Tamas Demjen <td*****@yahoo.com> wrote:
Hendrik Schober wrote:
I thought that this
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1
should do the trick, but I still get
iosfwd(582) : warning C4996: 'std::_Traits_helper::copy_s' was declared deprecated
using this.


Yes I have the same problem. Try to add _SCL_SECURE_NO_DEPRECATE [...]


Indeed, this seems to help. Thanks a lot!
(I am sure I failed to see that '_CRT_SECURE_NO_DEPRECATE'
and '_SCL_SECURE_NO_DEPRECATE' are two different defines
when I stumbled across them somewhere in the help...)


I just added '_CRT_NONSTDC_NO_DEPRECATE' to the mix
which got us rid of another few warnings that came
from some 3rd-party headers.
I'm actually down to about 10,000 warnings now, most
of which come from 3rd-party code. A typical edit-
compile scenario now finds mostly sensible warnings.
Yikes!

Schobi

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"The sarcasm is mightier than the sword."
Eric Jarvis
May 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

45 posts views Thread by Matt Parkins | last post: by
17 posts views Thread by B. Williams | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.