This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
egcs, warning patch for missing initializers in xsys-protos.h
- To: egcs-patches at cygnus dot com
- Subject: egcs, warning patch for missing initializers in xsys-protos.h
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 16 Sep 1998 10:42:24 -0400 (EDT)
The following patch gets the last couple of warnings from
gen-protos.c and removes 1350 warnings mainly of the form of missing
initializers in the generated file xsys-protos.h.
Okay to install?
--Kaveh
Tue Sep 15 14:07:45 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gen-protos.c (parse_fn_proto): Cast argument of ISALNUM to
`unsigned char'.
(main): Mark parameter `argc' with ATTRIBUTE_UNUSED.
When generating output, initialize missing struct member to zero.
diff -rup orig/egcs-CVS19980913/gcc/gen-protos.c egcs-CVS19980913/gcc/gen-protos.c
--- orig/egcs-CVS19980913/gcc/gen-protos.c Sun Sep 13 09:36:37 1998
+++ egcs-CVS19980913/gcc/gen-protos.c Tue Sep 15 14:03:24 1998
@@ -110,7 +110,7 @@ parse_fn_proto (start, end, fn)
ptr--;
while (*ptr == ' ' || *ptr == '\t') ptr--;
- if (!ISALNUM (*ptr))
+ if (!ISALNUM ((unsigned char)*ptr))
{
if (verbose)
fprintf (stderr, "%s: Can't handle this complex prototype: %s\n",
@@ -119,7 +119,7 @@ parse_fn_proto (start, end, fn)
}
name_end = ptr+1;
- while (ISALNUM (*ptr) || *ptr == '_') --ptr;
+ while (ISALNUM ((unsigned char)*ptr) || *ptr == '_') --ptr;
name_start = ptr+1;
while (*ptr == ' ' || *ptr == '\t') ptr--;
ptr[1] = 0;
@@ -140,7 +140,7 @@ parse_fn_proto (start, end, fn)
int
main (argc, argv)
- int argc;
+ int argc ATTRIBUTE_UNUSED;
char **argv;
{
FILE *inf = stdin;
@@ -158,7 +158,7 @@ main (argc, argv)
fprintf (outf, "struct fn_decl std_protos[] = {\n");
/* A hash table entry of 0 means "unused" so reserve it. */
- fprintf (outf, " {\"\", \"\", \"\"},\n");
+ fprintf (outf, " {\"\", \"\", \"\", 0},\n");
next_index = 1;
for (;;)
@@ -180,13 +180,13 @@ main (argc, argv)
add_hash (fn_decl.fname);
- fprintf (outf, " {\"%s\", \"%s\", \"%s\"},\n",
+ fprintf (outf, " {\"%s\", \"%s\", \"%s\", 0},\n",
fn_decl.fname, fn_decl.rtype, fn_decl.params);
if (c == EOF)
break;
}
- fprintf (outf, " {0, 0, 0}\n};\n");
+ fprintf (outf, " {0, 0, 0, 0}\n};\n");
fprintf (outf, "#define HASH_SIZE %d\n", HASH_SIZE);