Re: [MDADM PATCH 1/2] Add Wimplicit-fallthrough=0 in Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xiao Ni <xni@xxxxxxxxxx> writes:
> There are many errors like 'error: this statement may fall through'. 
> But the logic is right. So add the flag Wimplicit-fallthrough=0 
> to disable the error messages. The method I use is from 
> https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
> #index-Wimplicit-fallthrough-375
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index a6f464c..b9f52e0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -43,7 +43,7 @@ KLIBC_GCC = gcc -nostdinc -iwithprefix include
> -I$(KLIBC)/klibc/include -I$(KLIB
>  
>  CC ?= $(CROSS_COMPILE)gcc
>  CXFLAGS ?= -ggdb
> -CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
> +CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter -Wimplicit-fallthrough=0

Hi Xiao,

I am not sure how long -Wimplicit-fallthrough has existed. I want to
make sure we allow for this to compile with older compilers as well.

Could you please make it a check so this flag is only set if the version
of gcc supports it?

Thanks,
Jes


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux