# $FreeBSD: src/share/mk/bsd.kern.mk,v 1.17.2.1 2001/08/01 16:56:56 obrien Exp $ # Warning flags for compiling the kernel and components of the kernel. # # Note that -Werror is on by default. To turn it off, e.g. when working # on adding new warning options, NO_WERROR in make.conf (or on make(1)'s # command line) should be of material assistance. # CSTD?= gnu11 CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Wcast-qual \ -Wold-style-definition -Wmissing-include-dirs -Winit-self \ -Wundef _cnowarnflags= -Wno-pointer-sign _gccver= 0 .if ${CCVER:Mgcc*} _gccver= ${CCVER:S/gcc//} .endif .if ${_gccver} > 0 CWARNFLAGS+= -Wold-style-declaration _cnowarnflags+= -Wno-unused-but-set-variable .endif .if ${_gccver} >= 90 _cnowarnflags+= -Wno-address-of-packed-member .endif .if ${_gccver} >= 100 _cnowarnflags+= -Wno-zero-length-bounds .endif # Add -Wno-foo flags last .if !defined(WARNS_AUDIT) CWARNFLAGS+= ${_cnowarnflags} .endif # Require the proper use of 'extern' for variables. -fno-common will # cause duplicate declarations to generate a link error. # CFLAGS+= -fno-common # Prevent GCC 3.x from making certain libc based inline optimizations # CFLAGS+= -ffreestanding .include "../platform/${MACHINE_PLATFORM}/conf/kern.mk"