From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14517 invoked by alias); 4 Jun 2010 18:44:01 -0000 Received: (qmail 14500 invoked by uid 22791); 4 Jun 2010 18:44:00 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 04 Jun 2010 18:43:54 +0000 Received: (qmail invoked by alias); 04 Jun 2010 18:43:50 -0000 Received: from xdsl-89-0-137-113.netcologne.de (EHLO localhost.localdomain) [89.0.137.113] by mail.gmx.net (mp025) with SMTP; 04 Jun 2010 20:43:50 +0200 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1OKbry-0001CQ-Ej; Fri, 04 Jun 2010 20:43:50 +0200 Date: Fri, 04 Jun 2010 18:44:00 -0000 From: Ralf Wildenhues To: Paolo Bonzini Cc: Ian Lance Taylor , binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [PATCH] Fix PR bootstrap/42798 Message-ID: <20100604184348.GA4585@gmx.de> References: <20100601204405.GA1170@gmx.de> <20100602111845.GA16161@ins.uni-bonn.de> <4C064B77.3020207@gnu.org> <20100603063319.GC28276@gmx.de> <20100603065852.GA28617@gmx.de> <4C0915EF.6030906@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C0915EF.6030906@gnu.org> User-Agent: Mutt/1.5.20 (2009-10-28) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00128.txt.bz2 * 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