This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix Werror failures on alpha-linux
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Jan 2003 17:04:49 -0800
- Subject: fix Werror failures on alpha-linux
The fwrite bit is the most annoying. I guess I didn't check that
anyone else has these, but only in macro form. We'll hear soon
enough if that's the case, since fixincl will fail to link.
r~
* dwarf2out.c (lookup_filename): Fix printf format warning.
* system.h (fread_unlocked, fwrite_unlocked): Undef.
* fixinc/Makefile.in (FL_LIST): Add $($@-warn) hook.
(fixincl.o-warn, gnu-regex.o-warn): New.
* fixinc/fixfixes.c (FIX_PROC_HEAD): Mark parameters unused.
* fixinc/fixtests.c (TEST_FOR_FIX_PROC_HEAD): Likewise.
* fixinc/fixincl.c (process): Fix printf format warning.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.396
diff -c -p -d -u -r1.396 dwarf2out.c
--- dwarf2out.c 21 Jan 2003 23:10:07 -0000 1.396
+++ dwarf2out.c 22 Jan 2003 00:58:31 -0000
@@ -12354,7 +12354,7 @@ lookup_filename (file_name)
if (DWARF2_ASM_LINE_DEBUG_INFO)
{
- fprintf (asm_out_file, "\t.file %u ", i);
+ fprintf (asm_out_file, "\t.file %lu ", (unsigned long) i);
output_quoted_string (asm_out_file, file_name);
fputc ('\n', asm_out_file);
}
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.139
diff -c -p -d -u -r1.139 system.h
--- system.h 21 Jan 2003 02:44:37 -0000 1.139
+++ system.h 22 Jan 2003 00:58:31 -0000
@@ -99,6 +99,11 @@ extern int fprintf_unlocked PARAMS ((FIL
#endif
+/* ??? Glibc's fwrite/fread_unlocked macros cause
+ "warning: signed and unsigned type in conditional expression". */
+#undef fread_unlocked
+#undef fwrite_unlocked
+
/* There are an extraordinary number of issues with <ctype.h>.
The last straw is that it varies with the locale. Use libiberty's
replacement instead. */
Index: fixinc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/Makefile.in,v
retrieving revision 1.38
diff -c -p -d -u -r1.38 Makefile.in
--- fixinc/Makefile.in 25 Jun 2002 01:58:10 -0000 1.38
+++ fixinc/Makefile.in 22 Jan 2003 00:58:32 -0000
@@ -29,7 +29,7 @@ SHELL=@SHELL@
# in the kernel. So, we use `echo' instead.
STAMP = echo timestamp >
-FL_LIST = $(CFLAGS) $(CPPFLAGS) $(WARN_CFLAGS)
+FL_LIST = $(CFLAGS) $(CPPFLAGS) $(WARN_CFLAGS) $($@-warn)
FIXINC_DEFS = -DIN_GCC -DHAVE_CONFIG_H $(FL_LIST) $(INCLUDES)
# Directory where sources are, from where we are.
@@ -93,6 +93,11 @@ test-stamp : $(TESTOBJ) $(LIBERTY)
$(AF): $(FIXOBJ) $(LIBERTY)
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBERTY)
+
+# String length warnings
+fixincl.o-warn = -Wno-error
+# Signed/Unsigned warnings, but in code pulled from upstream.
+gnu-regex.o-warn = -Wno-error
$(ALLOBJ) : $(HDR)
fixincl.o : fixincl.c $(srcdir)/fixincl.x
Index: fixinc/fixfixes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixfixes.c,v
retrieving revision 1.44
diff -c -p -d -u -r1.44 fixfixes.c
--- fixinc/fixfixes.c 4 Jan 2003 21:14:53 -0000 1.44
+++ fixinc/fixfixes.c 22 Jan 2003 00:58:32 -0000
@@ -73,12 +73,12 @@ typedef struct {
_FT_( "gnu_type", gnu_type_fix )
-#define FIX_PROC_HEAD( fix ) \
-static void fix PARAMS ((const char *, const char *, tFixDesc *)); /* avoid warning */ \
-static void fix ( filname, text, p_fixd ) \
- const char* filname; \
- const char* text; \
- tFixDesc* p_fixd;
+#define FIX_PROC_HEAD( fix ) \
+static void fix PARAMS ((const char *, const char *, tFixDesc *)); \
+static void fix ( filname, text, p_fixd ) \
+ const char* filname ATTRIBUTE_UNUSED; \
+ const char* text ATTRIBUTE_UNUSED; \
+ tFixDesc* p_fixd ATTRIBUTE_UNUSED;
#ifdef NEED_PRINT_QUOTE
/*
Index: fixinc/fixincl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixincl.c,v
retrieving revision 1.58
diff -c -p -d -u -r1.58 fixincl.c
--- fixinc/fixincl.c 16 Dec 2002 18:58:41 -0000 1.58
+++ fixinc/fixincl.c 22 Jan 2003 00:58:32 -0000
@@ -1355,7 +1355,8 @@ process ()
process_ct++;
#endif
if (VLEVEL( VERB_PROGRESS ) && have_tty)
- fprintf (stderr, "%6d %-50s \r", data_map_size, pz_curr_file );
+ fprintf (stderr, "%6lu %-50s \r",
+ (unsigned long) data_map_size, pz_curr_file);
# ifndef SEPARATE_FIX_PROC
process_chain_head = NOPROCESS;
Index: fixinc/fixtests.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixtests.c,v
retrieving revision 1.27
diff -c -p -d -u -r1.27 fixtests.c
--- fixinc/fixtests.c 27 May 2001 18:21:03 -0000 1.27
+++ fixinc/fixtests.c 22 Jan 2003 00:58:32 -0000
@@ -58,15 +58,15 @@ typedef struct {
t_test_proc* test_proc;
} test_entry_t;
-#define FIX_TEST_TABLE \
- _FT_( "machine_name", machine_name_test ) \
+#define FIX_TEST_TABLE \
+ _FT_( "machine_name", machine_name_test ) \
_FT_( "stdc_0_in_system_headers", stdc_0_in_system_headers_test )
-#define TEST_FOR_FIX_PROC_HEAD( test ) \
-static apply_fix_p_t test PARAMS(( tCC* file, tCC* text )); \
-static apply_fix_p_t test ( fname, text ) \
- tCC* fname; \
- tCC* text;
+#define TEST_FOR_FIX_PROC_HEAD( test ) \
+static apply_fix_p_t test PARAMS(( tCC* file, tCC* text )); \
+static apply_fix_p_t test ( fname, text ) \
+ tCC* fname ATTRIBUTE_UNUSED; \
+ tCC* text ATTRIBUTE_UNUSED;
TEST_FOR_FIX_PROC_HEAD( machine_name_test )