[PATCH] missing declaration in libiberty.h

Ian Lance Taylor ian@airs.com
Tue Aug 16 14:51:00 GMT 2005


Jeff Baker <jbaker@qnx.com> writes:

> + #if !HAVE_DECL_STPCPY
> + extern char *stpcpy (char *__dest, const char *__src);
> + #endif
> +

You have to write the condition as

#if defined (HAVE_DECL_STPCPY) && !HAVE_DEC_STPCPY

Otherwise a program which makes no configure check for stpcpy will get
the declaration, which opens the possibility of conflicting with a
declaration in a system header file.

Also, you should not declare the parameter names.  That just creates a
possibility for conflict that we don't need to introduce.  So it
should just be

extern char *stpcpy (char *, const char *);

OK with those changes, but it has to be checked into the gcc
repository before the binutils repository.

Thanks.

Ian



More information about the Binutils mailing list