Drew wrote:
> If I may elaborate on this problem, most of the string handling
> routines (strcpy, strcat, sprintf...etc.) have a more 'managed'
> alternative that Microsoft encourages programmers to use.  These
> have the '_s' after them (strcpy_s, strcat_s, sprintf_s), and
> contain an additional argument that specifies the length of the
> character array that defines the string.  This prevents the code
> from buffer overruns because it checks the limits of the string
> length.

What a great idea!  If only the Unix folks had thought of that, what,
15 years ago. :) Seriously, here's a link to the "Single Unix
Standard", try checking the man pages for strncat, strncmp, strncpy,
strncasecmp, snprintf, etc...  This road has been traveled.  These
guys are all ancient functionality -- I'm pretty sure they were in the
original POSIX spec.

http://www.opengroup.org/onlinepubs/007908799/

Microsoft's idiocy number one is that they re-invented (after more
than a decade of consistent and pervasive use in Unix) the whole strn*
family of functions in a completely non-portable way.

Idiocy number two, and less forgivable IMHO, is that they have the
hubris to issue *warnings* about the use of functions specified in the
very standard (ISO C89) on which they base their compiler, while at
the same time *refusing* to support the more recent ISO C99
(c.f. flame war about Nasal's use of C99 features).

These MSDN jokers are a plague on the Earth.  Yet they survive (much
as do heroin dealers) because their IDE is apparently too attractive
to give up...  Yeah, that's a flame, but a provoked one.  Bring it
on. :)

Andy





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to