Re: localtime deprecated?
Bo Persson wrote:
<email@example.com> skrev i meddelandet
while compiling an existing project in the new MSVC 2005
compiler, I received the warning that:
: warning C4996: 'localtime' was declared deprecated
C:\Program Files\Microsoft Visual Studio
8\VC\include\time.inl(114) : see declaration of 'localtime'
Message: 'This function or variable may be unsafe. Consider
using localtime_s instead. To disable deprecation, use
_CRT_SECURE_NO_DEPRECATE. See online help for details.'
I wasn't aware that localtime was declared deprecated. Is
No. There is a proposal to the C standards committee though. Written
by Guess Who.
By who? A priori, by the ISO C committee, according to what I
can see. (As far as I know, Microsoft is not active in WG14.
Although I could be wrong, since I'm only indirectly active in
it myself. And don't forget that between the start of writing,
and the moment the document becomes official, it can easily take
Note that there is a problem with localtime in a multithreaded
environment, and that Posix has also proposed a replacement,
required on Posix conformant platforms which support threading.
James Kanze GABI Software
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]