This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
warnings patch for top level gcc directory
- To: egcs-patches at cygnus dot com
- Subject: warnings patch for top level gcc directory
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Sat, 17 Oct 1998 11:14:39 -0400 (EDT)
Here's a few more in the top level gcc directory.
Note: The haifa-sched.c include of recog.h doesn't need a Makefile.in
dependency counterpart because its already there. Also, I'm doing the
libgcc2.a reversion of noreturn because on OSF4 it (falsely IMHO) claims
it returns. Don't know why, but I wanted to play it safe.
Okay to install?
--Kaveh
Fri Oct 16 21:04:01 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (flow.o): Depend on recog.h.
* cpplib.h (directive_table): Add missing initializiers.
(finclude): Change type of variable `bsize' to size_t.
* cse.c (rtx_cost): Mark parameter `outer_code' with ATTRIBUTE_UNUSED.
* dwarfout.h (dwarfout_label): Wrap prototype in macro RTX_CODE.
* fix-header.c (lookup_std_proto): Cast the result of `strlen' to
`int' when comparing against one.
(cpp_file_line_for_message): Mark parameter `pfile' with
ATTRIBUTE_UNUSED.
(cpp_fatal): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
* flow.c: Include recog.h.
(sbitmap_copy): Cast arguments 1 & 2 of `bcopy' to (PTR).
* function.c (thread_prologue_and_epilogue_insns): Mark parameter
`f' with ATTRIBUTE_UNUSED.
(reposition_prologue_and_epilogue_notes): Likewise.
* genopinit.c (gen_insn): Cast argument of ctype functions to
`unsigned char'.
* haifa-sched.c: Include recog.h.
(blockage_range): Cast result of UNIT_BLOCKED macro to (int) when
comparing against one.
* libgcc2.a (__throw): Revert ATTRIBUTE_UNUSED change for now.
* mips-tfile.c (parse_end): Cast the argument of ctype function to
`unsigned char'.
(parse_ent): Likewise.
(parse_input): Likewise.
* optabs.c (init_libfuncs): Likewise.
* protoize.c (find_rightmost_formals_list): Likewise.
* recog.h (const_double_operand): Fix typo in prototype.
* tlink.c (scan_linker_output): Cast the argument of ctype
function to `unsigned char'.
* toplev.c (check_lang_option): Cast the result of `strlen' to
`int' when comparing against one.
diff -rup orig/egcs-CVS19981015/gcc/Makefile.in egcs-CVS19981015/gcc/Makefile.in
--- orig/egcs-CVS19981015/gcc/Makefile.in Thu Oct 15 20:00:11 1998
+++ egcs-CVS19981015/gcc/Makefile.in Fri Oct 16 15:07:57 1998
@@ -1477,7 +1477,7 @@ loop.o : loop.c $(CONFIG_H) system.h $(R
unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
integrate.h $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) loop.h toplev.h
flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) flags.h insn-config.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h
+ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h recog.h
combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h \
insn-config.h insn-flags.h insn-codes.h insn-attr.h $(REGS_H) $(EXPR_H) \
$(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h
diff -rup orig/egcs-CVS19981015/gcc/cpplib.c egcs-CVS19981015/gcc/cpplib.c
--- orig/egcs-CVS19981015/gcc/cpplib.c Thu Oct 15 20:00:26 1998
+++ egcs-CVS19981015/gcc/cpplib.c Fri Oct 16 15:03:42 1998
@@ -377,7 +377,7 @@ static int do_warning PARAMS ((cpp_reade
The initialize_builtins function assumes #define is the very first. */
static struct directive directive_table[] = {
- { 6, do_define, "define", T_DEFINE},
+ { 6, do_define, "define", T_DEFINE, 0},
{ 5, do_xifdef, "ifdef", T_IFDEF, 1},
{ 6, do_xifdef, "ifndef", T_IFNDEF, 1},
{ 7, do_include, "include", T_INCLUDE, 1},
@@ -387,18 +387,18 @@ static struct directive directive_table[
{ 4, do_else, "else", T_ELSE, 1},
{ 2, do_if, "if", T_IF, 1},
{ 4, do_elif, "elif", T_ELIF, 1},
- { 5, do_undef, "undef", T_UNDEF},
- { 5, do_error, "error", T_ERROR},
- { 7, do_warning, "warning", T_WARNING},
- { 6, do_pragma, "pragma", T_PRAGMA},
+ { 5, do_undef, "undef", T_UNDEF, 0},
+ { 5, do_error, "error", T_ERROR, 0},
+ { 7, do_warning, "warning", T_WARNING, 0},
+ { 6, do_pragma, "pragma", T_PRAGMA, 0},
{ 4, do_line, "line", T_LINE, 1},
{ 5, do_ident, "ident", T_IDENT, 1},
#ifdef SCCS_DIRECTIVE
- { 4, do_sccs, "sccs", T_SCCS},
+ { 4, do_sccs, "sccs", T_SCCS, 0},
#endif
{ 6, do_assert, "assert", T_ASSERT, 1},
{ 8, do_unassert, "unassert", T_UNASSERT, 1},
- { -1, 0, "", T_UNUSED},
+ { -1, 0, "", T_UNUSED, 0},
};
/* table to tell if char can be part of a C identifier. */
@@ -5628,7 +5628,7 @@ finclude (pfile, f, fname, system_header
First read the entire file into heap and
copy them into buffer on stack. */
- int bsize = 2000;
+ size_t bsize = 2000;
st_size = 0;
fp->buf = (U_CHAR *) xmalloc (bsize + 2);
diff -rup orig/egcs-CVS19981015/gcc/cse.c egcs-CVS19981015/gcc/cse.c
--- orig/egcs-CVS19981015/gcc/cse.c Thu Oct 15 20:00:27 1998
+++ egcs-CVS19981015/gcc/cse.c Fri Oct 16 15:03:42 1998
@@ -702,7 +702,7 @@ notreg_cost (x)
int
rtx_cost (x, outer_code)
rtx x;
- enum rtx_code outer_code;
+ enum rtx_code outer_code ATTRIBUTE_UNUSED;
{
register int i, j;
register enum rtx_code code;
diff -rup orig/egcs-CVS19981015/gcc/dwarfout.h egcs-CVS19981015/gcc/dwarfout.h
--- orig/egcs-CVS19981015/gcc/dwarfout.h Thu Oct 15 20:04:04 1998
+++ egcs-CVS19981015/gcc/dwarfout.h Fri Oct 16 15:03:42 1998
@@ -35,6 +35,8 @@ extern void dwarfout_end_epilogue PROTO
extern void dwarfout_begin_block PROTO ((unsigned));
extern void dwarfout_end_block PROTO ((unsigned));
+#ifdef RTX_CODE
extern void dwarfout_label PROTO ((rtx));
+#endif
extern void dwarfout_line PROTO ((char *, unsigned));
diff -rup orig/egcs-CVS19981015/gcc/fix-header.c egcs-CVS19981015/gcc/fix-header.c
--- orig/egcs-CVS19981015/gcc/fix-header.c Thu Oct 15 20:00:34 1998
+++ egcs-CVS19981015/gcc/fix-header.c Fri Oct 16 15:03:42 1998
@@ -397,7 +397,7 @@ lookup_std_proto (name, name_length)
if (hash_tab[i] == 0)
return NULL;
fn = &std_protos[hash_tab[i]];
- if (strlen (fn->fname) == name_length
+ if ((int) strlen (fn->fname) == name_length
&& strncmp (fn->fname, name, name_length) == 0)
return fn;
i = (i+1) % HASH_SIZE;
@@ -1326,7 +1326,7 @@ main (argc, argv)
void
cpp_file_line_for_message (pfile, filename, line, column)
- cpp_reader * pfile;
+ cpp_reader * pfile ATTRIBUTE_UNUSED;
char *filename;
int line, column;
{
@@ -1418,7 +1418,7 @@ fatal VPROTO ((const char *str, ...))
}
void
-cpp_fatal VPROTO ((cpp_reader * pfile, const char *str, ...))
+cpp_fatal VPROTO ((cpp_reader * pfile ATTRIBUTE_UNUSED, const char *str, ...))
{
#ifndef __STDC__
cpp_reader * pfile;
diff -rup orig/egcs-CVS19981015/gcc/flow.c egcs-CVS19981015/gcc/flow.c
--- orig/egcs-CVS19981015/gcc/flow.c Thu Oct 15 20:00:36 1998
+++ egcs-CVS19981015/gcc/flow.c Fri Oct 16 15:07:32 1998
@@ -122,6 +122,7 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "except.h"
#include "toplev.h"
+#include "recog.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
@@ -3709,7 +3710,7 @@ void
sbitmap_copy (dst, src)
sbitmap dst, src;
{
- bcopy (src->elms, dst->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
+ bcopy ((PTR) src->elms, (PTR) dst->elms, sizeof (SBITMAP_ELT_TYPE) * dst->size);
}
/* Zero all elements in a bitmap. */
diff -rup orig/egcs-CVS19981015/gcc/function.c egcs-CVS19981015/gcc/function.c
--- orig/egcs-CVS19981015/gcc/function.c Thu Oct 15 20:00:37 1998
+++ egcs-CVS19981015/gcc/function.c Fri Oct 16 15:03:42 1998
@@ -6183,7 +6183,7 @@ contains (insn, vec)
void
thread_prologue_and_epilogue_insns (f)
- rtx f;
+ rtx f ATTRIBUTE_UNUSED;
{
#ifdef HAVE_prologue
if (HAVE_prologue)
@@ -6284,7 +6284,7 @@ thread_prologue_and_epilogue_insns (f)
void
reposition_prologue_and_epilogue_notes (f)
- rtx f;
+ rtx f ATTRIBUTE_UNUSED;
{
#if defined (HAVE_prologue) || defined (HAVE_epilogue)
/* Reposition the prologue and epilogue notes. */
diff -rup orig/egcs-CVS19981015/gcc/genopinit.c egcs-CVS19981015/gcc/genopinit.c
--- orig/egcs-CVS19981015/gcc/genopinit.c Thu Oct 15 20:01:02 1998
+++ egcs-CVS19981015/gcc/genopinit.c Fri Oct 16 15:03:42 1998
@@ -202,7 +202,7 @@ gen_insn (insn)
for (i = ((int) MAX_MACHINE_MODE) - 1; i >= 0; i--)
{
for (p = mode_name[i], q = np; *p; p++, q++)
- if (tolower (*p) != *q)
+ if (tolower ((unsigned char)*p) != *q)
break;
if (*p == 0
@@ -256,11 +256,11 @@ gen_insn (insn)
break;
case 'a':
for (np = mode_name[m1]; *np; np++)
- printf ("%c", tolower (*np));
+ printf ("%c", tolower ((unsigned char)*np));
break;
case 'b':
for (np = mode_name[m2]; *np; np++)
- printf ("%c", tolower (*np));
+ printf ("%c", tolower ((unsigned char)*np));
break;
case 'A':
printf ("%smode", mode_name[m1]);
@@ -273,7 +273,7 @@ gen_insn (insn)
break;
case 'C':
for (np = rtx_name[op]; *np; np++)
- printf ("%c", toupper (*np));
+ printf ("%c", toupper ((unsigned char)*np));
break;
}
}
diff -rup orig/egcs-CVS19981015/gcc/haifa-sched.c egcs-CVS19981015/gcc/haifa-sched.c
--- orig/egcs-CVS19981015/gcc/haifa-sched.c Thu Oct 15 20:01:07 1998
+++ egcs-CVS19981015/gcc/haifa-sched.c Fri Oct 16 15:03:42 1998
@@ -166,6 +166,7 @@
#include "insn-attr.h"
#include "except.h"
#include "toplev.h"
+#include "recog.h"
extern char *reg_known_equiv_p;
extern rtx *reg_known_value;
@@ -2858,7 +2859,7 @@ blockage_range (unit, insn)
unsigned int blockage = INSN_BLOCKAGE (insn);
unsigned int range;
- if (UNIT_BLOCKED (blockage) != unit + 1)
+ if ((int) UNIT_BLOCKED (blockage) != unit + 1)
{
range = function_units[unit].blockage_range_function (insn);
/* We only cache the blockage range for one unit and then only if
diff -rup orig/egcs-CVS19981015/gcc/libgcc2.c egcs-CVS19981015/gcc/libgcc2.c
--- orig/egcs-CVS19981015/gcc/libgcc2.c Thu Oct 15 20:01:10 1998
+++ egcs-CVS19981015/gcc/libgcc2.c Fri Oct 16 15:03:42 1998
@@ -3637,7 +3637,7 @@ next_stack_level (void *pc, frame_state
If we find one, then we unwind the frames down to the one that
has the handler and transfer control into the handler. */
-extern void __throw(void) __attribute__ ((__noreturn__));
+/*extern void __throw(void) __attribute__ ((__noreturn__));*/
void
__throw ()
diff -rup orig/egcs-CVS19981015/gcc/mips-tfile.c egcs-CVS19981015/gcc/mips-tfile.c
--- orig/egcs-CVS19981015/gcc/mips-tfile.c Thu Oct 15 20:01:12 1998
+++ egcs-CVS19981015/gcc/mips-tfile.c Fri Oct 16 15:03:42 1998
@@ -3472,7 +3472,7 @@ parse_end (start)
}
/* Get the function name, skipping whitespace. */
- for (start_func = start; ISSPACE (*start_func); start_func++)
+ for (start_func = start; ISSPACE ((unsigned char)*start_func); start_func++)
;
ch = *start_func;
@@ -3531,7 +3531,7 @@ parse_ent (start)
return;
}
- for (start_func = start; ISSPACE (*start_func); start_func++)
+ for (start_func = start; ISSPACE ((unsigned char)*start_func); start_func++)
;
ch = *start_func;
@@ -3871,16 +3871,16 @@ parse_input __proto((void))
while ((p = read_line ()) != (char *) 0)
{
/* Skip leading blanks */
- while (ISSPACE (*p))
+ while (ISSPACE ((unsigned char)*p))
p++;
/* See if it's a directive we handle. If so, dispatch handler. */
for (i = 0; i < sizeof (pseudo_ops) / sizeof (pseudo_ops[0]); i++)
if (memcmp (p, pseudo_ops[i].name, pseudo_ops[i].len) == 0
- && ISSPACE (p[pseudo_ops[i].len]))
+ && ISSPACE ((unsigned char)(p[pseudo_ops[i].len])))
{
p += pseudo_ops[i].len; /* skip to first argument */
- while (ISSPACE (*p))
+ while (ISSPACE ((unsigned char)*p))
p++;
(*pseudo_ops[i].func)( p );
diff -rup orig/egcs-CVS19981015/gcc/optabs.c egcs-CVS19981015/gcc/optabs.c
--- orig/egcs-CVS19981015/gcc/optabs.c Thu Oct 15 20:01:13 1998
+++ egcs-CVS19981015/gcc/optabs.c Fri Oct 16 15:03:42 1998
@@ -4034,7 +4034,7 @@ init_libfuncs (optable, first_mode, last
for (q = opname; *q; )
*p++ = *q++;
for (q = mname; *q; q++)
- *p++ = tolower (*q);
+ *p++ = tolower ((unsigned char)*q);
*p++ = suffix;
*p++ = '\0';
optable->handlers[(int) mode].libfunc
diff -rup orig/egcs-CVS19981015/gcc/protoize.c egcs-CVS19981015/gcc/protoize.c
--- orig/egcs-CVS19981015/gcc/protoize.c Thu Oct 15 20:01:14 1998
+++ egcs-CVS19981015/gcc/protoize.c Fri Oct 16 15:03:43 1998
@@ -3447,8 +3447,8 @@ find_rightmost_formals_list (clean_text_
while (*end_formals != ')')
{
- if (ISSPACE (*end_formals))
- while (ISSPACE (*end_formals))
+ if (ISSPACE ((unsigned char)*end_formals))
+ while (ISSPACE ((unsigned char)*end_formals))
check_source (--end_formals > clean_read_ptr, 0);
else
check_source (--end_formals > clean_read_ptr, 0);
diff -rup orig/egcs-CVS19981015/gcc/recog.h egcs-CVS19981015/gcc/recog.h
--- orig/egcs-CVS19981015/gcc/recog.h Thu Oct 15 20:01:16 1998
+++ egcs-CVS19981015/gcc/recog.h Fri Oct 16 15:03:43 1998
@@ -44,7 +44,7 @@ extern int register_operand PROTO((rtx,
extern int scratch_operand PROTO((rtx, enum machine_mode));
extern int immediate_operand PROTO((rtx, enum machine_mode));
extern int const_int_operand PROTO((rtx, enum machine_mode));
-extern int cosnt_double_operand PROTO((rtx, enum machine_mode));
+extern int const_double_operand PROTO((rtx, enum machine_mode));
extern int nonimmediate_operand PROTO((rtx, enum machine_mode));
extern int nonmemory_operand PROTO((rtx, enum machine_mode));
extern int push_operand PROTO((rtx, enum machine_mode));
diff -rup orig/egcs-CVS19981015/gcc/tlink.c egcs-CVS19981015/gcc/tlink.c
--- orig/egcs-CVS19981015/gcc/tlink.c Thu Oct 15 20:01:23 1998
+++ egcs-CVS19981015/gcc/tlink.c Fri Oct 16 15:03:43 1998
@@ -530,13 +530,13 @@ scan_linker_output (fname)
symbol *sym;
int end;
- while (*p && ISSPACE (*p))
+ while (*p && ISSPACE ((unsigned char)*p))
++p;
if (! *p)
continue;
- for (q = p; *q && ! ISSPACE (*q); ++q)
+ for (q = p; *q && ! ISSPACE ((unsigned char)*q); ++q)
;
/* Try the first word on the line. */
diff -rup orig/egcs-CVS19981015/gcc/toplev.c egcs-CVS19981015/gcc/toplev.c
--- orig/egcs-CVS19981015/gcc/toplev.c Thu Oct 15 20:01:06 1998
+++ egcs-CVS19981015/gcc/toplev.c Fri Oct 16 15:03:43 1998
@@ -4174,7 +4174,7 @@ check_lang_option (option, lang_option)
-fpack-struct. */
/* An exact match is OK */
- if (strlen (option) == len)
+ if ((int) strlen (option) == len)
return 1;
/* If it is not an -f or -W option allow the match */