Skip to contentSkip to conversation

perfcounter: don't keep warnings treated as errors as default

PATCH In review Frederic Weisbecker 2 participants 2 messages Jun 4, 2009 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perfcounter: don't keep warnings treated as errors as default

Building userspace perfcounter tools gives such warning:

cc1: warnings being treated as errors
builtin-top.c: In function ‘print_sym_table’:
builtin-top.c:207: erreur: ignoring return value of ‘write’, declared with attribute warn_unused_result
make: *** [builtin-top.o] Erreur 1

It's about checking if a write was successful on stdout. The real point here is that treating each warning as errors by default can be avoided, especially for such harmless warning.

This patch drop -Werror from perfcounter tools makefile.

---
 Documentation/perf_counter/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/perf_counter/Makefile +1 -1
index c9ec458..9b42897 100644
@@ -159,7 +159,7 @@ uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
-CFLAGS = -ggdb3 -Wall -Werror -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement -O6 -march=native
+CFLAGS = -ggdb3 -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement -O6 -march=native
 LDFLAGS = -lpthread -lrt -lelf
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
Signature · 1 line
1.6.2.3
#1 lore raw
Quoted 6 lines · Frederic Weisbecker

Building userspace perfcounter tools gives such warning:

cc1: warnings being treated as errors
builtin-top.c: In function ‘print_sym_table’:
builtin-top.c:207: erreur: ignoring return value of ‘write’, declared with attribute warn_unused_result
make: *** [builtin-top.o] Erreur 1

I've fixed this by changing that line to puts(CONSOLE_CLEAR) (folded that into your other patch). Do you get any other warnings? We want to fix them really.

Ingo