public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Problems with gcc + exceptions + -pedantic + libiberty.h
@ 2002-01-07 16:07 John Levon
  2002-01-07 16:16 ` DJ Delorie
  2002-01-07 18:30 ` Andrew Cagney
  0 siblings, 2 replies; 13+ messages in thread
From: John Levon @ 2002-01-07 16:07 UTC (permalink / raw)
  To: binutils


This is on my system : binutils-2.10.0.18-1

libiberty.h has code as follows :

     39 /* HAVE_DECL_* is a three-state macro: undefined, 0 or 1.  If it is
     40    undefined, we haven't run the autoconf check so provide the
     41    declaration without arguments.  If it is 0, we checked and failed
     42    to find the declaration so provide a fully prototyped one.  If it
     43    is 1, we found it so don't provide any declaration at all.  */
     44 #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || (defined (HAVE_DECL_BASENAME) && !HAVE_DECL_BASENAME)
     45 extern char *basename PARAMS ((const char *));
     46 #else
     47 # if !defined (HAVE_DECL_BASENAME)
     48 extern char *basename ();
     49 # endif
     50 #endif

unfortunately, when compiled with g++ 3.x with exceptions enabled, and with -pedantic,
you get a (correct I think) error message stating that this prototype clashes with my
system's string.h :

    328 /* Return the file name within directory of FILENAME.  We don't
    329    declare the function if the `basename' macro is available (defined
    330    in <libgen.h>) which makes the XPG version of this function
    331    available.  */
    332 extern char *basename (__const char *__filename) __THROW;
    333 # endif

(from glibc-devel-2.2-12, RH 7.0). These clash as __THROW becomes throw(), unlike
libiberty's prototype which obviously has no exception specification.

Currently I have just worked around this problem by disabling -pedantic; however I would
prefer a real fix.

Does someone have any comments on whose bug this is, and, more importantly, what needs to
be done to fix the problem ?

thanks
john

-- 
"I went to set up a Yahoo ID for my dog. (Don't ask, but the DOG'S email was cluttering my inbox)." 
	- Ruthless Advisorette

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-06-24  5:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-07 16:07 Problems with gcc + exceptions + -pedantic + libiberty.h John Levon
2002-01-07 16:16 ` DJ Delorie
2002-01-07 16:21   ` Alan Modra
2002-01-07 17:38     ` DJ Delorie
2002-01-07 20:28       ` Alan Modra
2002-01-07 21:49         ` DJ Delorie
2002-01-08 11:23           ` John Levon
2002-01-08 12:52             ` DJ Delorie
2002-06-23 22:08           ` Alan Modra
2002-01-08 10:25         ` John Levon
2002-01-08 14:10           ` DJ Delorie
2002-01-08  3:02     ` Alan Modra
2002-01-07 18:30 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).