VC8 and C4996

H

Hendrik Schober

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.

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"The sarcasm is mightier than the sword."
Eric Jarvis
 
T

Tamas Demjen

Hendrik said:
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
 
H

Hendrik Schober

Tamas Demjen said:
Hendrik said:
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...)

Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"The sarcasm is mightier than the sword."
Eric Jarvis
 
H

Hendrik Schober

Hendrik Schober said:
Tamas Demjen said:
Hendrik said:
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

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"The sarcasm is mightier than the sword."
Eric Jarvis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top