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


One option is to not allow the use of basename() without the
HAVE_DECL_BASENAME test.  We can do this by #definining basename() to
you_forgot_the_have_decl_basename_check() in the non-prototype case in
libiberty.h.

I suspect that would break a *lot* of unsuspecting applications.  But,
we can't have a basename that's unprototyped on, for example, amd64
machines where the return type must be known (pointer vs int).

But how does gcc deal with system headers that have empty prototypes
for functions?  If we can hook into that, that would help.  But I
wouldn't recommend using <libiberty.h> where "libiberty.h" is
appropriate.

> I suppose there is a third option which is to simplify libiberty.h
> to always emit the prototype for basename.

basename is different because we *can't* just emit a prototype, as it
sometimes conflicts with the OS's prototype.

> basename is the only function in libiberty.h for which we can emit a
> non-prototype when HAVE_DECL_foo is undefined.

It's the only one that doesn't return "int" so we must, or we corrupt
pointers on 64-bit-pointer machines.


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