This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] missing declaration in libiberty.h


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]