Skip to contentSkip to conversation

[6028] target-ppc: use -Werror to make sure no new warning is added

Qemu-devel Aurelien Jarno 3 participants 6 messages Dec 14, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

Revision: 6028

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6028
Author:   aurel32
Date:     2008-12-14 11:12:28 +0000 (Sun, 14 Dec 2008)

Log Message:
-----------
target-ppc: use -Werror to make sure no new warning is added

Modified Paths:
--------------
trunk/Makefile.target

Modified: trunk/Makefile.target
===================================================================

Makefile.target +1 -1
@@ -641,7 +641,7 @@
 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
 endif
 ifeq ($(TARGET_BASE_ARCH), ppc)
-CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
+CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE -Werror
 # shared objects
 OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
 # PREP target
#1 lore raw
Quoted 3 lines · Aurelien Jarno

Log Message:
-----------
target-ppc: use -Werror to make sure no new warning is added

make -C ppc-softmmu all
make[1]: Entering directory `.../qemu/ppc-softmmu'
gcc ... .../qemu/vl.c
cc1: warnings being treated as errors
.../qemu/vl.c: In function 'host_alarm_handler':
.../qemu/vl.c:1352: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c: In function 'main':
.../qemu/vl.c:5202: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c:5515: error: ignoring return value of 'chdir', declared
with attribute warn_unused_result
make[1]: *** [vl.o] Error 1
make[1]: Leaving directory `.../qemu/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2

Also this one, which is a bit more trivial:

.../qemu/tcg/tcg.c: In function 'tcg_dump_ops':
.../qemu/tcg/tcg.c:889: warning: format not a string literal and no format arguments

tcg.c +1 -1
Index: tcg/tcg.c
===================================================================
@@ -886,7 +886,7 @@
             val = args[1];
             th = tcg_find_helper(s, val);
             if (th) {
-                fprintf(outfile, th->name);
+                fprintf(outfile, "%s", th->name);
             } else {
                 if (c == INDEX_op_movi_i32)
                     fprintf(outfile, "0x%x", (uint32_t)val);

Perhaps these should be fixed, but -Werror is a bit of a pain, as you can't choose which warnings are critical, and different warnings will be generated with different versions of gcc, different optimisation levels and different header files.

Additional warnings get added, and some warnings might become less noisy in the future... perhaps this one might just go away, given time:

.../qemu/target-cris/translate.c: In function 'dec_movem_mr':
.../qemu/target-cris/translate.c:2727: warning: 'tmp32' may be used uninitialized in this function

Cheers,

Signature · 1 line
Stuart Brady
#2 lore raw
Quoted 5 lines · Stuart Brady
Quoted 3 lines · Aurelien Jarno

Log Message:
-----------
target-ppc: use -Werror to make sure no new warning is added

Quoted 15 lines

make -C ppc-softmmu all
make[1]: Entering directory `.../qemu/ppc-softmmu'
gcc ... .../qemu/vl.c
cc1: warnings being treated as errors
.../qemu/vl.c: In function 'host_alarm_handler':
.../qemu/vl.c:1352: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c: In function 'main':
.../qemu/vl.c:5202: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c:5515: error: ignoring return value of 'chdir', declared
with attribute warn_unused_result
make[1]: *** [vl.o] Error 1
make[1]: Leaving directory `.../qemu/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2

Which compiler are you using? I don't have those warnings.

Quoted 38 lines

Also this one, which is a bit more trivial:

.../qemu/tcg/tcg.c: In function 'tcg_dump_ops':
.../qemu/tcg/tcg.c:889: warning: format not a string literal and no format arguments

Index: tcg/tcg.c
===================================================================

tcg.c +1 -1
@@ -886,7 +886,7 @@
             val = args[1];
             th = tcg_find_helper(s, val);
             if (th) {
-                fprintf(outfile, th->name);
+                fprintf(outfile, "%s", th->name);
             } else {
                 if (c == INDEX_op_movi_i32)
                     fprintf(outfile, "0x%x", (uint32_t)val);

Perhaps these should be fixed, but -Werror is a bit of a pain, as you can't choose which warnings are critical, and different warnings will be generated with different versions of gcc, different optimisation levels and different header files.

Additional warnings get added, and some warnings might become less noisy in the future... perhaps this one might just go away, given time:

.../qemu/target-cris/translate.c: In function 'dec_movem_mr':
.../qemu/target-cris/translate.c:2727: warning: 'tmp32' may be used uninitialized in this function

Cheers,

Signature · 1 line
Stuart Brady
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#3 lore raw
Quoted 7 lines · Aurelien Jarno
Quoted 4 lines · Stuart Brady

.../qemu/vl.c:5202: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c:5515: error: ignoring return value of 'chdir', declared
with attribute warn_unused_result

Which compiler are you using? I don't have those warnings.

GCC 4.3.2 with glibc 2.8.

Signature · 1 line
Stuart Brady
#5 lore raw
In reply to Aurelien Jarno
Quoted 22 lines · Aurelien Jarno
Quoted 5 lines · Stuart Brady
Quoted 3 lines · Aurelien Jarno

Log Message:
-----------
target-ppc: use -Werror to make sure no new warning is added

Quoted 15 lines

make -C ppc-softmmu all
make[1]: Entering directory `.../qemu/ppc-softmmu'
gcc ... .../qemu/vl.c
cc1: warnings being treated as errors
.../qemu/vl.c: In function 'host_alarm_handler':
.../qemu/vl.c:1352: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c: In function 'main':
.../qemu/vl.c:5202: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c:5515: error: ignoring return value of 'chdir', declared
with attribute warn_unused_result
make[1]: *** [vl.o] Error 1
make[1]: Leaving directory `.../qemu/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2

Quoted 1 line

Which compiler are you using? I don't have those warnings.

This warnings generate when glibc built with enabled FORTIFY_SOURCE.

Signature · 3 lines
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.org/
#4 lore raw
In reply to Stuart Brady
Quoted 10 lines · Stuart Brady
Quoted 7 lines · Aurelien Jarno
Quoted 4 lines · Stuart Brady

.../qemu/vl.c:5202: error: ignoring return value of 'write', declared
with attribute warn_unused_result
.../qemu/vl.c:5515: error: ignoring return value of 'chdir', declared
with attribute warn_unused_result

Which compiler are you using? I don't have those warnings.

GCC 4.3.2 with glibc 2.8.

FWIW, I'm only getting these warnings because the compiler I'm using happens to predefine _FORTIFY_SOURCE. (They're also only generated if you have GCC 4.1 or later, and are compiling with optimisation enabled.)

Cheers,

Signature · 1 line
Stuart Brady