This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Problems with gcc + exceptions + -pedantic + libiberty.h
- From: John Levon <levon at movementarian dot org>
- To: binutils at sources dot redhat dot com
- Date: Mon, 7 Jan 2002 23:53:20 +0000
- Subject: Problems with gcc + exceptions + -pedantic + libiberty.h
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