This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Your g++ breaks glibc.


Hi,

Your change:

1998-12-07  Jason Merrill  <jason@yorick.cygnus.com>

        * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
	were specified, set flag_pedantic_errors.

breaks glibc. That is a code fragment generated by autoconf. With gcc
2.95, I got

# gcc -S bar.cc
In file included from bar.cc:5:
/usr/include/stdlib.h:520: declaration of `exit(int)' throws different exceptions
bar.cc:2: previous declaration here

egcs 1.1.2 only gives a warning. It should be fixed in gcc 2.95.

How does this patch sound?

--- ../../import/gcc-2.95/egcs/gcc/cp/decl.c	Fri Jul  9 08:32:50 1999
+++ gcc/cp/decl.c	Wed Jul 14 12:51:56 1999
@@ -3516,7 +3516,8 @@ duplicate_decls (newdecl, olddecl)
 	  TREE_TYPE (olddecl) = build_exception_variant (newtype,
 							 TYPE_RAISES_EXCEPTIONS (oldtype));
 
-	  if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl))
+	  if ((pedantic || (! DECL_IN_SYSTEM_HEADER (olddecl)
+	  		    && ! DECL_IN_SYSTEM_HEADER (newdecl)))
 	      && DECL_SOURCE_LINE (olddecl) != 0
 	      && flag_exceptions
 	      && ! compexcepttypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl)))

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
extern "C" {
void exit (int);
};

#include <stdlib.h>

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