Hi Everbody:

To get rid of specific warning in 2008 vc++ or 2005 vc++

1>c:\documents and settings\user\my documents\visual studio 2008\projects\gmt\gmt\gmt.cpp(25) : warning C4996: '_gmtime64': This function or variable may be unsafe. Consider using _gmtime64_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        c:\program files\microsoft visual studio 9.0\vc\include\time.h(209) : see declaration of '_gmtime64'

Project Properties
Configuration Properties
Disable Specific Warnings

You will find the



pragma warning( disable : 4996 )

Will not work!

Regards herge

Warning 4996 is the height of stupidity, so I'll hard disable it in the project settings without any hesitation. Go to your project properties, then uder C/C++->Advanced there will be an option for disabling specific warnings. Add 4996 to that list and enjoy never seeing that ridiculous warning again.

Hi deceptikon:
Nothing annoys me more than a warning. With imformation that for a lack of
better word was written by someone missing certain skills?
The odds that a microsoft example will work are Not Good!

Regards Herge

Another way to disable warnings just for specific *.c or *.cpp files is to use pragma

#pragma warning(disable: 4996)

But I like deceptikon's suggestion better.

But I like decepikon's suggestion better.

Me too. I shouldn't have to break my code's portability to disable a spurious warning from the compiler. And in this case I don't, but it does involve a configuration for each project. Slightly irritating, but not nearly as irritating as locking myself into Visual Studio or adding ugly conditional compilation just to silence a warning that doen't apply to me in the first place (I know how to safely use the "unsafe" functions).