This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: nonnull markings in sys/cdefs.h causes trouble with gcc-3.3 ?
On Thu, Apr 07, 2005 at 09:54:41PM -0500, Mike Frysinger wrote:
> On Thursday 07 April 2005 10:42 pm, Roland McGrath wrote:
> > Like I said, don't request the libc function to be declared. You can do
> > what you want with names not in the libc name space you are compiling
> > against. If you want strcasestr to yourself, don't use _GNU_SOURCE.
>
> well like i half said, simply doing '#include <string.h>' will declare
> strcasestr(), even if you dont '#define _GNU_SOURCE' before hand:
> $ cat string.cpp
> #include <string.h>
> $ g++ -E string.cpp | grep -A 1 strcasestr
> extern char *strcasestr (__const char *__haystack, __const char *__needle)
> throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
G++ defines -D_GNU_SOURCE for you.
--
Daniel Jacobowitz
CodeSourcery, LLC