Messages in this thread | | | Date | Thu, 22 Apr 2021 12:21:33 -0700 | From | Kees Cook <> | Subject | Re: [PATCH] x86/boot/compressed: enable -Wundef |
| |
On Thu, Apr 22, 2021 at 12:04:42PM -0700, Nick Desaulniers wrote: > A discussion around -Wundef showed that there were still a few boolean > Kconfigs where #if was used rather than #ifdef to guard different code. > Kconfig doesn't define boolean configs, which can result in -Wundef > warnings. > > arch/x86/boot/compressed/Makefile resets the CFLAGS used for this > directory, and doesn't re-enable -Wundef as the top level Makefile does. > If re-added, with RANDOMIZE_BASE and X86_NEED_RELOCS disabled, the > following warnings are visible. > > arch/x86/boot/compressed/misc.h:82:5: warning: 'CONFIG_RANDOMIZE_BASE' > is not defined, evaluates to 0 [-Wundef] > ^ > arch/x86/boot/compressed/misc.c:175:5: warning: 'CONFIG_X86_NEED_RELOCS' > is not defined, evaluates to 0 [-Wundef] > ^ > > Simply fix these and re-enable this warning for this directory. > > Suggested-by: Nathan Chancellor <nathan@kernel.org> > Suggested-by: Joe Perches <joe@perches.com> > Link: https://github.com/ClangBuiltLinux/linux/issues/570 > Link: https://lore.kernel.org/lkml/67f6cd269684c9aa8463ff4812c3b4605e6739c3.camel@perches.com/ > Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Thanks!
Acked-by: Kees Cook <keescook@chromium.org>
-- Kees Cook
| |