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


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


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