Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft _s functions, are they part of the C++ standard now?

Tags:

c++

standards

I just recently changed my IDE to MS Visual Studio 2005 coming from MSVC++ 6, and I've gotten a lot of deprecation warnings. Rather than ignore the warning, I started to change them to the _s equivalents. However, I then found out that these were microsoft-only implementations.

I read somewhere that they were pushing for these to become part of the standard. Is it?

Is it a good idea to use these _s functions? Or should I use something else?

Thanks.

like image 822
krebstar Avatar asked Mar 06 '09 03:03

krebstar


1 Answers

The *_s() functions are not part of the C standard, but there is a pending 'Technical Report' proposing that they be added (I'm not sure if the routines in the TR are exactly the same as Microsoft's or if they're just similar).

TR 24731-1: Extensions to the C Library Part I: Bounds-checking interfaces:

  • http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1225.pdf

If you want to continue to use the old functions you can keep the deprecation warnings quiet by defining the macro _CRT_SECURE_NO_WARNINGS (was _CRT_SECURE_NO_DEPRECATE which might still be supported).

like image 148
Michael Burr Avatar answered Sep 19 '22 11:09

Michael Burr