This is the mail archive of the binutils@sources.redhat.com 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: Another HP-UX IA64 Build patch


James E Wilson <wilson@specifixinc.com> writes:

> On Thu, 2005-05-05 at 10:51, Steve Ellcey wrote:
>> I see it doesn't have the const modifier that libiberty has.  I didn't
>> get a warning or error presumbably because the build didn't include
>> libgen.h.
>
> This is a libiberty bug.  Try "man basename" on a linux system, and it
> will tell you that there are two versions of basename.  The posix one
> which takes a char * argument, and a glibc _GNU_SOURCE one which takes a
> const char * argument.  So this probably should be something like
> #if defined(_GNU_SOURCE)
> extern char *basename (const char *);
> #elif defined...
> extern char *basename (char *);
> #else
> extern char *basename ();
> #endif

Note that the POSIX basename function may modify the string in place (when
removing trailing slashes).  The GNU (and libiberty) version (naturally)
never does this.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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