On Mon, Mar 05, 2007 at 05:48:57PM +0100, Klaas-Jan Stol wrote:
> On 3/5/07, jerry gay <[EMAIL PROTECTED]> wrote:

> >instead of disabling the *valid* compiler warning, i suggest that
> >either we modify our coding standard to allow C<strdup>, or we rename
> >all usage to C<_strdup> and #define as appropriate for each compiler.
> 
> 
> Moreover, strdup was not deprecated without a reason; strdup is claimed to
> be unsafe. It might be a good idea to accept this piece of advice, and use
> _strdup and friends.

I read that and though "huh?"

A better answer seems to be further down in:

  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=6995&SiteID=1


   strdup(), stricmp(), and strnicmp() have also been deprecated, and I
   assumed it was also related to security, but it's not.  They are
   deprecated simply because they are not part of the ANCI C or C++
   standard, and as such should always have been prefixed by an underscore.
   This was a historical mistake that Microsoft has now rectified in VS
   2005.


IIRC ANSI have reserved every function name starting str, so this is correct.
They've also reserved every type ending _t, but it seems that few pay
attention to that either.

Nicholas Clark

Reply via email to