This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATCH] missing declaration in libiberty.h
- From: Jeff Baker <jbaker at qnx dot com>
- To: 'Ian Lance Taylor' <ian at airs dot com>, Jeff Baker <jbaker at qnx dot com>
- Cc: "'binutils at sourceware dot org'" <binutils at sourceware dot org>
- Date: Tue, 16 Aug 2005 14:53:19 -0400
- Subject: RE: [PATCH] missing declaration in libiberty.h
I see that HJ is already working on a solution to this problem so I'll wait
for him.
-----Original Message-----
From: Ian Lance Taylor [mailto:ian@airs.com]
Sent: Tuesday, August 16, 2005 10:51 AM
To: Jeff Baker
Cc: 'binutils@sourceware.org'
Subject: 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