Index: ../../../conf/kern.mk =================================================================== --- ../../../conf/kern.mk (wersja 188288) +++ ../../../conf/kern.mk (kopia robocza) @@ -12,14 +12,21 @@ .else CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - ${_wundef} ${_Wno_pointer_sign} -fformat-extensions + ${_wundef} ${_Wno_pointer_sign} -fformat-extensions \ + ${_Wunreachable_code} .if !defined(WITH_GCC3) _Wno_pointer_sign=-Wno-pointer-sign +_Werror_no_pointer_sign=-Werror=pointer-sign .endif .if !defined(NO_UNDEF) _wundef= -Wundef +_werror_undef=-Werror=undef .endif +.if defined(UNREACHABLE_CODE) +_Wunreachable_code=-Wunreachable-code -Wno-error=unreachable-code .endif +.endif + # # The following flags are next up for working on: # -W Index: ../../../conf/kern.pre.mk =================================================================== --- ../../../conf/kern.pre.mk (wersja 188292) +++ ../../../conf/kern.pre.mk (kopia robocza) @@ -93,8 +93,16 @@ CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 +.if defined(UNREACHABLE_CODE) +# Keep this list synchronized with list of warnings present in kern.mk +WERROR?= -Werror=all -Werror=redundant-decls -Werror=nested-externs \ + -Werror=missing-prototypes -Werror=pointer-arith \ + -Werror=inline -Werror=cast-qual ${_Werror_no_pointer_sign} \ + ${_werror_undef} +.else WERROR?= -Werror .endif +.endif # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}