Microsoft are really losing it
Dec. 6th, 2006 03:48 pmXXXXX.c(118) : warning C4996: 'fopen' was declared deprecated
c:\program files\microsoft visual studio 8\VC\include\stdio.h(234) : see
declaration of 'fopen'
Message: 'This function or variable may be unsafe. Consider using fopen_
s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help
for details.'
(no subject)
Date: 2006-12-06 03:49 pm (UTC)(no subject)
Date: 2006-12-06 03:51 pm (UTC)(no subject)
Date: 2006-12-06 04:06 pm (UTC)"Security-Enhanced Versions of CRT Functions" really ought to give a more detailed breakdown, but mysteriously doesn't.
And even
fopen_s's own page ducks the issue, saying nebulously that it contains "security enhancements as described in" the first page. Arrgh!Doing a visual diff between
fopen_s's page andfopen's page suggests that the two relevant differences are thatfopen_s(a) does not open files in sharable mode by default (whereasfopen's page leaves it unspecified whether it does this), and (b) validates its input parameters to ensure they're neitherNULLnor the empty string, and returns anerrnovalue if they are, rather than segfaulting. I suppose they might not have wanted to do (a) by means of a quiet change to the existing function's behaviour, because there will probably have been people relying on that behaviour.All in all, not an impressive effort of documentation, let alone a good reason to deprecate one of the most standard C library functions in existence!
(no subject)
Date: 2006-12-06 04:08 pm (UTC)(no subject)
Date: 2006-12-06 04:29 pm (UTC)(no subject)
Date: 2006-12-06 04:35 pm (UTC)It's *entirely* me.
(no subject)
Date: 2006-12-06 04:28 pm (UTC)(no subject)
Date: 2006-12-06 04:45 pm (UTC)#pragma warning ( disable : 4996 )(to go with all the others).(no subject)
Date: 2006-12-06 04:57 pm (UTC)(no subject)
Date: 2006-12-06 05:30 pm (UTC)(no subject)
Date: 2006-12-09 06:13 pm (UTC)(no subject)
Date: 2006-12-09 06:10 pm (UTC)