4 # Warning flags for compiling the kernel and components of the kernel.
6 # Note that the newly added -Wcast-qual is responsible for generating
7 # most of the remaining warnings. Warnings introduced with -Wall will
8 # also pop up, but are easier to fix.
10 # XXX FIXME - revert when there is a gcc3 with -fformat-extensions
12 CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
13 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
14 -fformat-extensions -ansi
16 CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
17 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
21 # The following flags are next up for working on:
24 # When working on removing warnings from code, the `-Werror' flag should be
25 # of material assistance.
29 # On the i386, do not align the stack to 16-byte boundaries. Otherwise GCC
30 # 2.95 adds code to the entry and exit point of every function to align the
31 # stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack
32 # per function call. While the 16-byte alignment may benefit micro benchmarks,
33 # it is probably an overall loss as it makes the code bigger (less efficient
34 # use of code cache tag lines) and uses more stack (less efficient use of data
37 .if ${MACHINE_ARCH} == "i386"
38 CFLAGS+= -mpreferred-stack-boundary=2
42 # On the alpha, make sure that we don't use floating-point registers and
43 # allow the use of EV56 instructions (only needed for low-level i/o).
44 # Also, reserve register t7 to point at per-cpu global variables.
46 .if ${MACHINE_ARCH} == "alpha"
47 CFLAGS+= -mno-fp-regs -ffixed-8 -Wa,-mev56
51 # For IA-64, we use r13 for the kernel globals pointer and we only use
52 # a very small subset of float registers for integer divides.
54 .if ${MACHINE_ARCH} == "ia64"
55 CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127
59 # GCC 3.0 and above like to do certain optimizations based on the
60 # assumption that the program is linked against libc. Stop this.
63 CFLAGS+= -ffreestanding