This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: C++: warn about implicit declarations of built-in functions


In article <20000527213118.N10272@wolery.cumb.org> you write:
>Index: cp/tinfo2.cc
>--- cp/tinfo2.cc	2000/05/25 11:49:33	1.24
>+++ cp/tinfo2.cc	2000/05/28 04:26:05
>@@ -28,6 +28,7 @@
> // the GNU General Public License.
> 
> #include <stddef.h>
>+#include <stdlib.h>		// for abort
> #include "tinfo.h"
> #include "new"			// for placement new

This change isn't correct for when inhibit_libc is defined. The following
patch fixes this. Can someone please apply?

Thanks,

Jifl

2000-06-01  Jonathan Larmour  <jlarmour@redhat.co.uk>

	* tinfo2.cc: Don't include stdlib.h if inhibit_libc defined.

Index: cp/tinfo2.cc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/tinfo2.cc,v
retrieving revision 1.25
diff -u -5 -p -r1.25 tinfo2.cc
--- cp/tinfo2.cc	2000/05/30 15:44:20	1.25
+++ cp/tinfo2.cc	2000/06/01 17:05:42
@@ -26,11 +26,15 @@
 // the GNU General Public License.  This exception does not however
 // invalidate any other reasons why the executable file might be covered by
 // the GNU General Public License.
 
 #include <stddef.h>
+#ifndef inhibit_libc
 #include <stdlib.h>		// for abort
+#else
+extern void abort(void);
+#endif
 #include "tinfo.h"
 #include "new"			// for placement new
 
 using std::type_info;
 
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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