ewx: (Default)
[personal profile] ewx
XXXXX.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)
From: [identity profile] pjc50.livejournal.com
Why is this? Is it due to the behaviour of fopen("CON:", ...) or something?

(no subject)

Date: 2006-12-06 03:51 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
They've crapped on a whole bunch of standard functions in the same way. In some cases it's fair enough, e.g. sprintf() and strcpy(), but fopen()? Come on.

(no subject)

Date: 2006-12-06 04:06 pm (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
A brief google turns up "Security Enhancements in the CRT", which is depressingly generic: it just gives a list of reasons why a function might be worth replacing with a secured version, but doesn't list for each individual function why they did.

"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 and fopen's page suggests that the two relevant differences are that fopen_s (a) does not open files in sharable mode by default (whereas fopen's page leaves it unspecified whether it does this), and (b) validates its input parameters to ensure they're neither NULL nor the empty string, and returns an errno value 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)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
I suspect it to be no more than fire and motion (http://www.joelonsoftware.com/articles/fog0000000339.html).

(no subject)

Date: 2006-12-06 04:29 pm (UTC)
emperor: (Default)
From: [personal profile] emperor
That article *so* describes my working habits :-(

(no subject)

Date: 2006-12-06 04:35 pm (UTC)
From: [identity profile] covertmusic.livejournal.com
It's not just you. It's most people I know here.

It's *entirely* me.

November 2025

S M T W T F S
      1
2345678
91011121314 15
1617 181920 2122
23242526272829
30      

Most Popular Tags

Expand Cut Tags

No cut tags