From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5584 invoked by alias); 9 May 2005 23:06:26 -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 5477 invoked from network); 9 May 2005 23:06:18 -0000 Received: from unknown (HELO palrel13.hp.com) (156.153.255.238) by sourceware.org with SMTP; 9 May 2005 23:06:18 -0000 Received: from smtp1.ptp.hp.com (smtp1.ptp.hp.com [15.1.28.250]) by palrel13.hp.com (Postfix) with ESMTP id D909E1C037EE; Mon, 9 May 2005 16:06:17 -0700 (PDT) Received: from hpsje.cup.hp.com (hpsje.cup.hp.com [15.244.96.221]) by smtp1.ptp.hp.com (Postfix) with ESMTP id 3ADBF1564FB; Mon, 9 May 2005 23:06:16 +0000 (UTC) Received: (from sje@localhost) by hpsje.cup.hp.com (8.9.3 (PHNE_24419+JAGae58098)/8.7.3 TIS Messaging 5.0) id QAA01931; Mon, 9 May 2005 16:06:15 -0700 (PDT) Date: Mon, 09 May 2005 23:28:00 -0000 From: Steve Ellcey Message-Id: <200505092306.QAA01931@hpsje.cup.hp.com> To: wilson@specifixinc.com, dj@redhat.com Cc: binutils@sources.redhat.com Subject: Re: Another HP-UX IA64 Build patch In-Reply-To: <200505060157.j461v1LR017215@greed.delorie.com> X-SW-Source: 2005-05/txt/msg00357.txt.bz2 > From: DJ Delorie > > No, I'm proposing that we do NOT declare basename if the application > didn't run the HAVE_DECL test. However, to prevent applications from > using basename() without the HAVE_DECL test (the char * return > problem), we then add a #define to effectively poison it. > > Thus, we need the HAVE_DECL test if we use basename(), but if we don't > use basename() we don't need the HAVE_DECL test. So how about something like the following (tested on IA64 HP-UX): include/ChangeLog: 2005-05-09 Steve Ellcey libiberty.h: Do not define empty basename prototype. *** src.orig/include/libiberty.h Thu May 5 10:04:07 2005 --- src/include/libiberty.h Mon May 9 16:03:12 2005 *************** extern char **dupargv (char **) ATTRIBUT *** 97,103 **** #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) extern char *basename (const char *); #else ! extern char *basename (); #endif #endif --- 97,106 ---- #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) extern char *basename (const char *); #else ! /* Do not allow basename to be used if there is no prototype seen. We ! either need to use the above prototype or have one from ! autoconf which would result in HAVE_DECL_BASENAME being set. */ ! #define basename basename_cannot_be_used_without_a_prototype #endif #endif