CVS-19981211: Patch 2 to prevent multiple inclusion if <sys/stat.h>

Manfred Hollstein manfred@s-direktnet.de
Fri Dec 11 02:41:00 GMT 1998


On Fri, 11 December 1998, 11:09:37, manfred@s-direktnet.de wrote:

 > The include files on my m68k-motorola-sysv system are not protected
 > against multiple inclusion. The patch below fixes a problem I got
 > today while compiling cccp.c:
 > 
 > In file included from ../../egcs-19981211/gcc/cccp.c:31:
 > /u/b60/manfred/gnu/delta/lib/gcc-lib/delta/egcs-2.90.27/include/sys/stat.h:13: redefinition of `struct stat'
 > 

The same happens with toplev.c:

In file included from ../../egcs-19981211/gcc/toplev.c:32:
/u/b60/manfred/gnu/delta/lib/gcc-lib/delta/egcs-2.90.27/include/sys/stat.h:13: redefinition of `struct stat'

fgrep 'sys/stat.h' gcc/*.c shows, that collect2.c, gcc.c, and various
other files also #include both "system.h" and <sys/stat.h>. How do all
these buglets come back? I could have sworn, I've fixed them long ago...

manfred

PS: This patch includes my earlier one for cccp.c!

1998-12-11  Manfred Hollstein  <manfred@s-direktnet.de>

	* cccp.c: Do not #include <sys/stat.h> here; this is already done
	by "system.h".
	* collect2.c: Likewise.
	* gcc.c: Likewise.
	* gcov.c: Likewise.
	* getpwd.c: Likewise.
	* protoize.c: Likewise.
	* toplev.c: Likewise.

diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981211.orig/gcc/cccp.c egcs-19981211/gcc/cccp.c
--- egcs-19981211.orig/gcc/cccp.c	Thu Dec 10 10:47:21 1998
+++ egcs-19981211/gcc/cccp.c	Fri Dec 11 10:56:00 1998
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
 #define PRINTF_PROTO_4(ARGS) PRINTF_PROTO(ARGS, 4, 5)
 
 #include "system.h"
-#include <sys/stat.h>
 #include <signal.h>
 
 #ifdef HAVE_SYS_RESOURCE_H
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981211.orig/gcc/collect2.c egcs-19981211/gcc/collect2.c
--- egcs-19981211.orig/gcc/collect2.c	Fri Dec 11 08:14:10 1998
+++ egcs-19981211/gcc/collect2.c	Fri Dec 11 11:31:43 1998
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA.  */
 #include "config.h"
 #include "system.h"
 #include <signal.h>
-#include <sys/stat.h>
 
 #ifdef vfork /* Autoconf may define this to fork for us. */
 # define VFORK_STRING "fork"
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981211.orig/gcc/gcc.c egcs-19981211/gcc/gcc.c
--- egcs-19981211.orig/gcc/gcc.c	Wed Dec  9 10:10:41 1998
+++ egcs-19981211/gcc/gcc.c	Fri Dec 11 11:31:59 1998
@@ -34,7 +34,6 @@ compilation is specified by a string cal
 #include "config.h"
 #include "system.h"
 #include <signal.h>
-#include <sys/stat.h>
 
 #include "obstack.h"
 
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981211.orig/gcc/gcov.c egcs-19981211/gcc/gcov.c
--- egcs-19981211.orig/gcc/gcov.c	Mon Nov 30 12:24:11 1998
+++ egcs-19981211/gcc/gcov.c	Fri Dec 11 11:32:08 1998
@@ -43,7 +43,6 @@ the Free Software Foundation, 675 Mass A
 
 #include "config.h"
 #include "system.h"
-#include <sys/stat.h>
 
 #include "gcov-io.h"
 
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981211.orig/gcc/getpwd.c egcs-19981211/gcc/getpwd.c
--- egcs-19981211.orig/gcc/getpwd.c	Mon Nov 30 12:24:26 1998
+++ egcs-19981211/gcc/getpwd.c	Fri Dec 11 11:32:13 1998
@@ -2,7 +2,6 @@
 
 #include "config.h"
 #include "system.h"
-#include <sys/stat.h>
 
 /* Virtually every UN*X system now in common use (except for pre-4.3-tahoe
    BSD systems) now provides getcwd as called for by POSIX.  Allow for
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981211.orig/gcc/protoize.c egcs-19981211/gcc/protoize.c
--- egcs-19981211.orig/gcc/protoize.c	Mon Nov 30 12:24:35 1998
+++ egcs-19981211/gcc/protoize.c	Fri Dec 11 11:32:41 1998
@@ -58,7 +58,6 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #include "system.h"
-#include <sys/stat.h>
 #if ! defined (_WIN32) || defined (__CYGWIN__)
 #if defined(POSIX) || defined(CONCURRENT)
 #include <dirent.h>
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19981211.orig/gcc/toplev.c egcs-19981211/gcc/toplev.c
--- egcs-19981211.orig/gcc/toplev.c	Tue Dec  8 12:46:38 1998
+++ egcs-19981211/gcc/toplev.c	Fri Dec 11 11:24:02 1998
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA.  */
 #include "system.h"
 #include <signal.h>
 #include <setjmp.h>
-#include <sys/stat.h>
 
 #ifdef HAVE_SYS_RESOURCE_H
 # include <sys/resource.h>



More information about the Gcc-patches mailing list