This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Another HP-UX IA64 Build patch


> From: DJ Delorie <dj@redhat.com>
>
> 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  <sje@cup.hp.com>

	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
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]