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]

Patch to remove warnings in gcc/genoutput.c and gcc/rtl.c



I'm appending a patch to avoid the following warning:
../../cvs/gcc/gcc/genoutput.c:144: warning: missing initializer
../../cvs/gcc/gcc/genoutput.c:144: warning: (near initialization for `null_operand.seen')

and for this one:
../../cvs/gcc/gcc/rtl.c: In function `read_rtx':
../../cvs/gcc/gcc/rtl.c:817: warning: implicit declaration of function `fatal'
../../cvs/gcc/gcc/rtl.c: At top level:
../../cvs/gcc/gcc/rtl.c:1139: warning: type mismatch with previous implicit declaration
../../cvs/gcc/gcc/rtl.c:817: warning: previous implicit declaration of `fatal'
../../cvs/gcc/gcc/rtl.c:1139: warning: `fatal' was previously implicitly declared to return `int'

Btw. we've got prototypes for fatal in the following places:
collect2.h:46:extern void fatal PARAMS ((const char *, ...)) 
errors.h:30:void fatal   PVPROTO ((const char *format, ...))
gcc.h:29:extern void fatal PARAMS ((const char *, ...))
toplev.h:38:extern void fatal			PVPROTO ((const char *, ...))

I've included errors.h and also added some externs to errors.h and
updated the dependencies.

Andreas

1999-11-01  Andreas Jaeger  <aj@suse.de>

	* Makefile.in (rtl.o): Add dependency on errors.h.

	* errors.h: Add extern to prototypes.

	* genoutput.c (null_operand =): Initialize all fields.

	* rtl.c: Remove fatal prototype and include "errors.h" instead.


--- genoutput.c.~1~	Sat Oct 23 08:11:04 1999
+++ genoutput.c	Mon Nov  1 12:15:42 1999
@@ -140,7 +140,7 @@
 
 static struct operand_data null_operand =
 {
-  0, 0, "", "", VOIDmode, 0, 0, 0, 0
+  0, 0, "", "", VOIDmode, 0, 0, 0, 0, 0
 };
 
 static struct operand_data *odata = &null_operand;

--- Makefile.in.~1~	Mon Nov  1 11:36:26 1999
+++ Makefile.in	Mon Nov  1 12:35:53 1999
@@ -1469,7 +1469,7 @@
 	  -DTARGET_NAME=\"$(target_alias)\" \
 	  -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
 
-rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h ggc.h
+rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h ggc.h errors.h
 
 print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h basic-block.h
 rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
--- errors.h.~1~	Sun Sep  5 13:30:33 1999
+++ errors.h	Mon Nov  1 12:35:34 1999
@@ -25,9 +25,9 @@
 #ifndef __GCC_ERRORS_H__
 #define __GCC_ERRORS_H__
 
-void warning PVPROTO ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
-void error   PVPROTO ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
-void fatal   PVPROTO ((const char *format, ...))
+extern void warning PVPROTO ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
+extern void error   PVPROTO ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
+extern void fatal   PVPROTO ((const char *format, ...))
     ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 
 extern int have_error;
--- rtl.c.~1~	Mon Nov  1 11:36:30 1999
+++ rtl.c	Mon Nov  1 12:34:22 1999
@@ -26,6 +26,7 @@
 #include "real.h"
 #include "bitmap.h"
 #include "ggc.h"
+#include "errors.h"
 #include "obstack.h"
 #define	obstack_chunk_alloc	xmalloc
 #define	obstack_chunk_free	free
@@ -1135,8 +1136,6 @@
 /* Report an internal compiler error in a friendly manner and without
    dumping core.  */
 
-extern void fatal PVPROTO ((const char *, ...))
-  ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 
 void
 fancy_abort (file, line, function)

-- 
 Andreas Jaeger   
  SuSE Labs aj@suse.de	
   private aj@arthur.rhein-neckar.de

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