This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to tsystem.h to avoid getopt prototype warnings
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to tsystem.h to avoid getopt prototype warnings
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Thu, 26 Oct 2000 11:33:18 -0400 (EDT)
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>