From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13243 invoked by alias); 5 May 2005 21:36:17 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 13166 invoked from network); 5 May 2005 21:36:09 -0000 Received: from unknown (HELO mx2.suse.de) (195.135.220.15) by sourceware.org with SMTP; 5 May 2005 21:36:09 -0000 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 49F2D96E3; Thu, 5 May 2005 23:36:05 +0200 (CEST) From: Andreas Schwab To: James E Wilson Cc: Steve Ellcey , drow@false.org, binutils@sources.redhat.com Subject: Re: Another HP-UX IA64 Build patch References: <200505051751.KAA17543@hpsje.cup.hp.com> <1115316630.8413.20.camel@aretha.corp.specifixinc.com> X-Yow: Life is a POPULARITY CONTEST! I'm REFRESHINGLY CANDID!! Date: Thu, 05 May 2005 21:40:00 -0000 In-Reply-To: <1115316630.8413.20.camel@aretha.corp.specifixinc.com> (James E. Wilson's message of "Thu, 05 May 2005 11:10:30 -0700") Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-05/txt/msg00211.txt.bz2 James E Wilson 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."