1 ifneq (,$(filter gcc%,$(CC)))
2 _gccversion:=$(shell $(CC) -dumpversion)
3 _gccmachine:=$(shell $(CC) -dumpmachine)
4 _cobjs := .objs-$(_gccmachine:-linux-gnu=)-$(_gccversion)
6 # Use pipes and not temp files.
10 # let the type char be unsigned by default
11 CFLAGS += -funsigned-char
12 CFLAGS += -fstrict-aliasing
13 # turn on all common warnings
15 # turn on extra warnings
16 CFLAGS += $(if $(filter 4.%,$(GCCVERSION)),-W,-Wextra)
17 # treat warnings as errors
19 CFLAGS += -Wchar-subscripts
20 # warn about undefined preprocessor identifiers
22 # warn about local variable shadowing another local variable
24 # warn about casting of pointers to increased alignment requirements
25 CFLAGS += -Wcast-align
26 # make string constants const
27 CFLAGS += -Wwrite-strings
28 # warn about implicit conversions with side effects
29 # fgets, calloc and friends take an int, not size_t...
30 #CFLAGS += -Wconversion
31 # warn about comparisons between signed and unsigned values
32 CFLAGS += -Wsign-compare
33 # warn about unused declared stuff
35 # don not warn about unused return value
36 CFLAGS += -Wno-unused-value
37 # warn about variable use before initialization
38 CFLAGS += -Wuninitialized
39 # warn about pointer arithmetic on void* and function pointers
40 CFLAGS += -Wpointer-arith
41 # warn about multiple declarations
42 CFLAGS += -Wredundant-decls
43 # warn if the format string is not a string literal
44 CFLAGS += -Wformat-nonliteral
45 # do not warn about strftime format with y2k issues
46 CFLAGS += -Wno-format-y2k
54 LDFLAGS += -Wl,--warn-common