From 3130b84e94717fe9aad67a14defe79bb7f10fa9f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sat, 28 Jan 2017 12:12:25 -0800 Subject: [PATCH] Add -Wno-declaration-after-statement to KERNELCPPFLAGS Disable the warnings regarding ISO C90 forbidding mixed declarations and code. While this functionality was introduced as part of C99 gcc does allow this in C90 mode as an extension. https://gcc.gnu.org/onlinedocs/gcc/Mixed-Declarations.html#Mixed-Declarations Allowing this usage helps minimize the changes required when porting patches from OpenZFS. The downside here is that this functionality is specific to gcc. Reviewed-by: George Melikov Signed-off-by: Brian Behlendorf Closes #5686 --- config/kernel.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/config/kernel.m4 b/config/kernel.m4 index afb0cc7faa..a441328378 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -123,6 +123,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other dnl # compiler options are added by the kernel build system. + KERNELCPPFLAGS="$KERNELCPPFLAGS -Wno-declaration-after-statement" KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE" KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_BOOL_COMPARE" KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"