Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: Ian Lance Taylor <iant@google.com>,
	binutils@sourceware.org,	gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix PR bootstrap/42798
Date: Fri, 04 Jun 2010 18:44:00 -0000	[thread overview]
Message-ID: <20100604184348.GA4585@gmx.de> (raw)
In-Reply-To: <4C0915EF.6030906@gnu.org>

* Paolo Bonzini wrote on Fri, Jun 04, 2010 at 05:04:15PM CEST:
> On 06/04/2010 04:59 PM, Ian Lance Taylor wrote:
> >With regard to the gold change.  What will happen if the system header
> >files provide only a declaration
> >     char *basename(const char *)
> >?
> 
> I think it works, because C casts are allowed to do anything they
> want to constness.

Well, the respective configure test for
  AC_CHECK_DECL([basename(char*)])

in C++ mode tries to compile something like
  (void) basename ((char*) 0);

it doesn't try to ensure that the declaration is the same as the one
you're using.  So in fact not using 'const' is safer that using it.
Hmm, maybe the Autoconf manual should be clearer about this.  Anyway,
this method only works for argument types for which a cast of 0 makes
sense.

Cheers,
Ralf


  reply	other threads:[~2010-06-04 18:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100601204405.GA1170@gmx.de>
     [not found] ` <AANLkTim4-8VpK907cHTIcT2ELeZEgOBpLf0FUJmpPCJN@mail.gmail.com>
     [not found]   ` <20100602111845.GA16161@ins.uni-bonn.de>
     [not found]     ` <4C064B77.3020207@gnu.org>
2010-06-03  6:33       ` Ralf Wildenhues
2010-06-03  6:59         ` Ralf Wildenhues
2010-06-04 14:59           ` Ian Lance Taylor
2010-06-04 15:04             ` Paolo Bonzini
2010-06-04 18:44               ` Ralf Wildenhues [this message]
2010-06-06 11:28             ` Ralf Wildenhues
2010-06-06 21:42               ` Ian Lance Taylor
2010-06-07  6:11                 ` Ralf Wildenhues
2010-06-07 14:04                   ` Ian Lance Taylor
2010-06-07 20:24                     ` Ralf Wildenhues

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=20100604184348.GA4585@gmx.de \
    --to=ralf.wildenhues@gmx.de \
    --cc=binutils@sourceware.org \
    --cc=bonzini@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=iant@google.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