This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch for fortran warning fixes ...
- To: burley at gnu dot org
- Subject: patch for fortran warning fixes ...
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Sat, 10 Oct 1998 01:22:40 -0400 (EDT)
- Cc: egcs-patches at cygnus dot com
Here's a pass of warning fixes in the fortran directory. It
fixes the following warnings which occurred on my mips-sgi-irix6.2
system. Okay to install?
--Kaveh
> % ./contrib/warn_summary -f output
>
> Counting warnings in the gcc/f subdirectory,
> there are 46 warnings in stage3 of this bootstrap.
>
> Number of warnings per file:
> 28 stb.c
> 5 lex.c
> 4 bad.c
> 2 intrin.c
> 1 where.c
> 1 top.c
> 1 malloc.c
> 1 implic.c
> 1 fini.c
> 1 com.c
> 1 /usr/include/sys/param.h
>
> Number of warning types:
> 40 subscript has type `char'
> 3 missing initializer for `???'
> 1 unused parameter `???'
> 1 this is the location of the previous definition
> 1 `???' redefined
Fri Oct 9 23:44:21 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bad.c (ffebad_finish): Change type of variable `c' to unsigned
char, change type of variable `s' to unsigned char *.
* com.c (ffecom_symbol_null_): Add missing initializers.
* fini.c (MAXNAMELEN): Undef it before defining.
* implic.c (ffeimplic_lookup_): Change type of parameter `c' to
unsigned char.
* intrin.c (ffeintrin_init_0): Cast the argument to ctype macros
to (unsigned char).
* lex.c (ffelex_splice_tokens): Change type of variable `p' to
unsigned char *.
(ffelex_token_name_from_names): Cast the argument of
`ffelex_is_firstnamechar' to (unsigned char).
(ffelex_token_names_from_names): Likewise.
(ffelex_token_new_name): Likewise.
(ffelex_token_new_names): Likewise.
* malloc.c (malloc_root_): Add missing initializer.
* stb.c (ffestb_do): Change type of variable `p' to unsigned char *.
(ffestb_else) Likewise.
(ffestb_else3_) Likewise.
(ffestb_endxyz) Likewise.
(ffestb_goto) Likewise.
(ffestb_let) Likewise.
(ffestb_varlist) Likewise.
(ffestb_R522) Likewise.
(ffestb_R528) Likewise.
(ffestb_R834) Likewise.
(ffestb_R835) Likewise.
(ffestb_R838) Likewise.
(ffestb_R1102) Likewise.
(ffestb_blockdata) Likewise.
(ffestb_R1212) Likewise.
(ffestb_R810) Likewise.
(ffestb_R10014_): Cast the argument of `ffelex_is_firstnamechar'
to (unsigned char).
(ffestb_V014): Change type of variable `p' to unsigned char *.
(ffestb_dummy) Likewise.
(ffestb_R524) Likewise.
(ffestb_R547) Likewise.
(ffestb_decl_chartype) Likewise.
(ffestb_decl_dbltype) Likewise.
(ffestb_decl_gentype) Likewise.
(ffestb_decl_entsp_2_) Likewise.
(ffestb_V027) Likewise.
(ffestb_decl_R539) Likewise.
* top.c (ffe_decode_option): Mark parameter `argc' with
ATTRIBUTE_UNUSED.
* where.c (ffewhere_unknown_line_): Add missing initializers.
diff -rup orig/egcs-CVS19981009/gcc/f/bad.c egcs-CVS19981009/gcc/f/bad.c
--- orig/egcs-CVS19981009/gcc/f/bad.c Fri Oct 9 20:28:17 1998
+++ egcs-CVS19981009/gcc/f/bad.c Fri Oct 9 22:37:06 1998
@@ -372,8 +372,8 @@ ffebad_finish ()
ffebadIndex bi;
unsigned short i;
char pointer;
- char c;
- char *s;
+ unsigned char c;
+ unsigned char *s;
char *fn;
static char buf[1024];
int bufi;
diff -rup orig/egcs-CVS19981009/gcc/f/com.c egcs-CVS19981009/gcc/f/com.c
--- orig/egcs-CVS19981009/gcc/f/com.c Fri Oct 9 20:28:18 1998
+++ egcs-CVS19981009/gcc/f/com.c Fri Oct 9 22:41:28 1998
@@ -302,6 +302,8 @@ ffecomSymbol ffecom_symbol_null_
NULL_TREE,
NULL_TREE,
NULL_TREE,
+ NULL_TREE,
+ false
};
ffeinfoKindtype ffecom_pointer_kind_ = FFEINFO_basictypeNONE;
ffeinfoKindtype ffecom_label_kind_ = FFEINFO_basictypeNONE;
diff -rup orig/egcs-CVS19981009/gcc/f/fini.c egcs-CVS19981009/gcc/f/fini.c
--- orig/egcs-CVS19981009/gcc/f/fini.c Fri Oct 9 20:28:20 1998
+++ egcs-CVS19981009/gcc/f/fini.c Fri Oct 9 22:44:46 1998
@@ -24,6 +24,7 @@ the Free Software Foundation, 59 Temple
#include "proj.h"
#include "malloc.h"
+#undef MAXNAMELEN
#define MAXNAMELEN 100
typedef struct _name_ *name;
diff -rup orig/egcs-CVS19981009/gcc/f/implic.c egcs-CVS19981009/gcc/f/implic.c
--- orig/egcs-CVS19981009/gcc/f/implic.c Fri Oct 9 20:28:21 1998
+++ egcs-CVS19981009/gcc/f/implic.c Fri Oct 9 22:46:42 1998
@@ -73,7 +73,7 @@ static struct _ffeimplic_ ffeimplic_tabl
/* Static functions (internal). */
-static ffeimplic_ ffeimplic_lookup_ (char c);
+static ffeimplic_ ffeimplic_lookup_ (unsigned char c);
/* Internal macros. */
@@ -89,7 +89,7 @@ static ffeimplic_ ffeimplic_lookup_ (cha
data type. */
static ffeimplic_
-ffeimplic_lookup_ (char c)
+ffeimplic_lookup_ (unsigned char c)
{
/* NOTE: This is definitely ASCII-specific!! */
if (ISALPHA (c) || (c == '_'))
diff -rup orig/egcs-CVS19981009/gcc/f/intrin.c egcs-CVS19981009/gcc/f/intrin.c
--- orig/egcs-CVS19981009/gcc/f/intrin.c Fri Oct 9 20:28:23 1998
+++ egcs-CVS19981009/gcc/f/intrin.c Fri Oct 9 22:49:59 1998
@@ -1558,7 +1558,7 @@ ffeintrin_init_0 ()
break;
if ((ISDIGIT (*p1) || (*p1 == '_')) && (*p1 == *p2) && (*p1 == *p3))
continue;
- if (! ISUPPER (*p1) || ! ISLOWER (*p2)
+ if (! ISUPPER ((unsigned char)*p1) || ! ISLOWER ((unsigned char)*p2)
|| (*p1 != toupper (*p2)) || ((*p3 != *p1) && (*p3 != *p2)))
break;
}
diff -rup orig/egcs-CVS19981009/gcc/f/lex.c egcs-CVS19981009/gcc/f/lex.c
--- orig/egcs-CVS19981009/gcc/f/lex.c Fri Oct 9 20:28:23 1998
+++ egcs-CVS19981009/gcc/f/lex.c Fri Oct 9 23:03:12 1998
@@ -4347,7 +4347,7 @@ ffelexHandler
ffelex_splice_tokens (ffelexHandler first, ffelexToken master,
ffeTokenLength start)
{
- char *p;
+ unsigned char *p;
ffeTokenLength i;
ffelexToken t;
@@ -4490,7 +4490,7 @@ ffelex_token_name_from_names (ffelexToke
assert (len > 0);
assert ((start + len) <= t->length);
}
- assert (ffelex_is_firstnamechar (t->text[start]));
+ assert (ffelex_is_firstnamechar ((unsigned char)(t->text[start])));
nt = ffelex_token_new_ ();
nt->type = FFELEX_typeNAME;
@@ -4525,7 +4525,7 @@ ffelex_token_names_from_names (ffelexTok
assert (len > 0);
assert ((start + len) <= t->length);
}
- assert (ffelex_is_firstnamechar (t->text[start]));
+ assert (ffelex_is_firstnamechar ((unsigned char)(t->text[start])));
nt = ffelex_token_new_ ();
nt->type = FFELEX_typeNAMES;
@@ -4585,7 +4585,7 @@ ffelex_token_new_name (char *s, ffewhere
{
ffelexToken t;
- assert (ffelex_is_firstnamechar (*s));
+ assert (ffelex_is_firstnamechar ((unsigned char)*s));
t = ffelex_token_new_ ();
t->type = FFELEX_typeNAME;
@@ -4606,7 +4606,7 @@ ffelex_token_new_names (char *s, ffewher
{
ffelexToken t;
- assert (ffelex_is_firstnamechar (*s));
+ assert (ffelex_is_firstnamechar ((unsigned char)*s));
t = ffelex_token_new_ ();
t->type = FFELEX_typeNAMES;
diff -rup orig/egcs-CVS19981009/gcc/f/malloc.c egcs-CVS19981009/gcc/f/malloc.c
--- orig/egcs-CVS19981009/gcc/f/malloc.c Fri Oct 9 20:28:22 1998
+++ egcs-CVS19981009/gcc/f/malloc.c Fri Oct 9 22:55:04 1998
@@ -52,6 +52,8 @@ struct _malloc_root_ malloc_root_
0,
#if MALLOC_DEBUG
0, 0, 0, 0, 0, 0, 0, { '/' }
+#else
+ { 0 }
#endif
},
};
diff -rup orig/egcs-CVS19981009/gcc/f/stb.c egcs-CVS19981009/gcc/f/stb.c
--- orig/egcs-CVS19981009/gcc/f/stb.c Fri Oct 9 20:28:25 1998
+++ egcs-CVS19981009/gcc/f/stb.c Fri Oct 9 23:34:03 1998
@@ -1859,7 +1859,7 @@ ffelexHandler
ffestb_do (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexHandler next;
ffelexToken nt;
ffestrSecond kw;
@@ -2507,7 +2507,7 @@ ffelexHandler
ffestb_else (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -2787,7 +2787,7 @@ static ffelexHandler
ffestb_else3_ (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelex_set_names (FALSE);
@@ -3013,7 +3013,7 @@ ffelexHandler
ffestb_endxyz (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -3319,7 +3319,7 @@ ffelexHandler
ffestb_goto (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexHandler next;
ffelexToken nt;
@@ -4152,7 +4152,7 @@ ffestb_let (ffelexToken t)
ffelexHandler next;
bool vxtparam; /* TRUE if it might really be a VXT PARAMETER
stmt. */
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -4537,7 +4537,7 @@ ffelexHandler
ffestb_varlist (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexToken nt;
ffelexHandler next;
@@ -5284,7 +5284,7 @@ ffelexHandler
ffestb_R522 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexToken nt;
ffelexHandler next;
@@ -5528,7 +5528,7 @@ ffestb_R5224_ (ffelexToken t)
ffelexHandler
ffestb_R528 (ffelexToken t)
{
- char *p;
+ unsigned char *p;
ffeTokenLength i;
ffelexToken nt;
ffelexHandler next;
@@ -6419,7 +6419,7 @@ ffelexHandler
ffestb_R834 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -6534,7 +6534,7 @@ ffelexHandler
ffestb_R835 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -6648,7 +6648,7 @@ ffestb_R8351_ (ffelexToken t)
ffelexHandler
ffestb_R838 (ffelexToken t)
{
- char *p;
+ unsigned char *p;
ffeTokenLength i;
ffelexHandler next;
ffelexToken et; /* First token in target. */
@@ -7141,7 +7141,7 @@ ffelexHandler
ffestb_R1102 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -7293,7 +7293,7 @@ ffelexHandler
ffestb_blockdata (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -7436,7 +7436,7 @@ ffelexHandler
ffestb_R1212 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexHandler next;
ffelexToken nt;
@@ -8630,7 +8630,7 @@ ffelexHandler
ffestb_R810 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -9709,7 +9709,8 @@ ffestb_R10014_ (ffelexToken t)
i += ffelex_token_length (ffestb_local_.format.post.t);
if (*p == '\0')
return (ffelexHandler) ffestb_R10016_;
- if ((kw != FFESTR_formatP) || !ffelex_is_firstnamechar (*p))
+ if ((kw != FFESTR_formatP) ||
+ !ffelex_is_firstnamechar ((unsigned char)*p))
{
if (ffestb_local_.format.current != FFESTP_formattypeH)
ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER, t, i, NULL);
@@ -12165,7 +12166,7 @@ ffelexHandler
ffestb_V014 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexToken nt;
ffelexHandler next;
@@ -19399,7 +19400,7 @@ ffelexHandler
ffestb_dummy (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
switch (ffelex_token_type (ffesta_tokens[0]))
{
@@ -19618,7 +19619,7 @@ ffelexHandler
ffestb_R524 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexToken nt;
ffelexHandler next;
@@ -19847,7 +19848,7 @@ ffelexHandler
ffestb_R547 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexToken nt;
ffelexHandler next;
@@ -20485,7 +20486,7 @@ ffelexHandler
ffestb_decl_chartype (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffestb_local_.decl.type = FFESTP_typeCHARACTER;
ffestb_local_.decl.recursive = NULL;
@@ -20672,7 +20673,7 @@ ffelexHandler
ffestb_decl_dbltype (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffestb_local_.decl.type = ffestb_args.decl.type;
ffestb_local_.decl.recursive = NULL;
@@ -20863,7 +20864,7 @@ ffelexHandler
ffestb_decl_gentype (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffestb_local_.decl.type = ffestb_args.decl.type;
ffestb_local_.decl.recursive = NULL;
@@ -22667,7 +22668,7 @@ ffestb_decl_entsp_2_ (ffelexToken t)
{
ffelexToken nt;
bool asterisk_ok;
- char *p;
+ unsigned char *p;
ffeTokenLength i;
switch (ffelex_token_type (t))
@@ -24156,7 +24157,7 @@ ffestb_V0166_ (ffelexToken t)
ffelexHandler
ffestb_V027 (ffelexToken t)
{
- char *p;
+ unsigned char *p;
ffeTokenLength i;
switch (ffelex_token_type (ffesta_tokens[0]))
@@ -24336,7 +24337,7 @@ ffelexHandler
ffestb_decl_R539 (ffelexToken t)
{
ffeTokenLength i;
- char *p;
+ unsigned char *p;
ffelexToken nt;
ffestrSecond kw;
diff -rup orig/egcs-CVS19981009/gcc/f/top.c egcs-CVS19981009/gcc/f/top.c
--- orig/egcs-CVS19981009/gcc/f/top.c Fri Oct 9 20:28:29 1998
+++ egcs-CVS19981009/gcc/f/top.c Fri Oct 9 23:35:56 1998
@@ -162,7 +162,7 @@ ffe_is_digit_string_ (char *s)
int
ffe_decode_option (argc, argv)
- int argc;
+ int argc ATTRIBUTE_UNUSED;
char **argv;
{
char *opt = argv[0];
diff -rup orig/egcs-CVS19981009/gcc/f/where.c egcs-CVS19981009/gcc/f/where.c
--- orig/egcs-CVS19981009/gcc/f/where.c Fri Oct 9 20:28:29 1998
+++ egcs-CVS19981009/gcc/f/where.c Fri Oct 9 23:37:10 1998
@@ -38,7 +38,7 @@ the Free Software Foundation, 59 Temple
struct _ffewhere_line_ ffewhere_unknown_line_
=
-{NULL, NULL, 0, 0, 0};
+{NULL, NULL, 0, 0, 0, {0}};
/* Simple definitions and enumerations. */