public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: wilson@specifixinc.com
Cc: sje@cup.hp.com, binutils@sources.redhat.com
Subject: Re: Another HP-UX IA64 Build patch
Date: Thu, 05 May 2005 22:46:00 -0000	[thread overview]
Message-ID: <200505052224.j45MOH22019801@greed.delorie.com> (raw)
In-Reply-To: <1115329225.8413.146.camel@aretha.corp.specifixinc.com> (message from James E Wilson on Thu, 05 May 2005 14:40:25 -0700)


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.

  reply	other threads:[~2005-05-05 22:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 17:26 Steve Ellcey
2005-05-05 17:41 ` Daniel Jacobowitz
2005-05-05 17:55   ` Steve Ellcey
2005-05-05 18:12     ` James E Wilson
2005-05-05 18:16       ` Daniel Jacobowitz
2005-05-05 19:17         ` James E Wilson
2005-05-05 19:32       ` DJ Delorie
2005-05-05 19:47         ` James E Wilson
2005-05-05 21:40       ` Andreas Schwab
2005-05-05 21:43         ` DJ Delorie
2005-05-05 18:10 ` James E Wilson
2005-05-05 20:12 ` James E Wilson
2005-05-05 20:42   ` Steve Ellcey
2005-05-05 21:36     ` DJ Delorie
2005-05-05 21:41       ` James E Wilson
2005-05-05 22:46         ` DJ Delorie [this message]
2005-05-06  1:57           ` James E Wilson
2005-05-06  1:58             ` DJ Delorie
2005-05-09 23:28               ` Steve Ellcey
2005-05-09 23:33                 ` DJ Delorie
2005-05-12 16:37                   ` Steve Ellcey
2005-05-05 22:06   ` James E Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200505052224.j45MOH22019801@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=sje@cup.hp.com \
    --cc=wilson@specifixinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).