This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] missing declaration in libiberty.h
- From: Ian Lance Taylor <ian at airs dot com>
- To: Jeff Baker <jbaker at qnx dot com>
- Cc: "'binutils at sourceware dot org'" <binutils at sourceware dot org>
- Date: 16 Aug 2005 07:50:49 -0700
- Subject: Re: [PATCH] missing declaration in libiberty.h
- References: <3518719F06577C4F85DA618E3C37AB9133BB8D@nimbus.ott.qnx.com>
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