This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: FYI: strdup() -> xstrdup()
- To: dj at delorie dot com
- Subject: Re: FYI: strdup() -> xstrdup()
- From: Stan Shebs <shebs at cygnus dot com>
- Date: Mon, 22 Nov 1999 14:51:43 -0800
- CC: gdb-patches at sourceware dot cygnus dot com
Date: Mon, 22 Nov 1999 17:36:50 -0500
From: DJ Delorie <dj@delorie.com>
> Strdup is a standard function,
It's neither ANSI nor POSIX.1(1990). Is it finally in some other
spec?
Doh! I knew I should have doublechecked before pontificating. It's,
uh, standard on, uh, Sun, yeah, that's it. It's standard on Suns. :-)
Or how about this: "People who should know better think strdup is a
standard function."
> and a year from now somebody will forget about xstrdup and use the
> standard function instead.
#define strdup dont_use_strdup__use_xstrdup_instead
...
#undef strdup
strdup()
{
dont_use_strdup__use_xstrdup_instead();
}
Given strdup's nonstandard status, this is a good idea.
Stan