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 tsystem.h to avoid getopt prototype warnings


When I bootstrap gcc on Irix6.2, I get over 100 warnings from
libgcc2.c which look like this:

 > include/getopt.h:114: warning: function declaration isn't a prototype

Fixed thusly.  Bootstrapped on Irix6.2, okay to install?


2000-10-24  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* tsystem.h: Define HAVE_DECL_GETOPT.

--- egcs-CVS20001022/gcc/tsystem.h~	Tue Feb  1 16:24:43 2000
+++ egcs-CVS20001022/gcc/tsystem.h	Tue Oct 24 10:51:26 2000
@@ -22,6 +22,15 @@ Boston, MA 02111-1307, USA.  */
 #ifndef __GCC_TSYSTEM_H__
 #define __GCC_TSYSTEM_H__
 
+/* System headers (e.g. stdio.h, stdlib.h, unistd.h) often include
+   getopt.h.  Our -I flags will cause gcc's gnu getopt.h to be
+   included.  In the default case, it will provide us with a
+   no-argument prototype which will generate -Wstrict-prototypes warnings.
+   Tell gnu getopt.h we don't need this prototype.  */
+#ifndef HAVE_DECL_GETOPT
+#define HAVE_DECL_GETOPT 1
+#endif
+
 /* GCC supplies this header. */
 #include <stddef.h>
 

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