From: Timm Bäder Date: Thu, 27 Jan 2022 15:05:33 +0000 (+0100) Subject: build: Make GCC ignore fallthrough comments X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~4^2~44^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7194196100bf7c08ba2d1d1664738efd6cd3fa78;p=gtk4.git build: Make GCC ignore fallthrough comments From the GCC manpage: > Wimplicit-fallthrough=5 doesn't recognize any comments as > fallthrough comments, only attributes disable > the warning. So, check for the =5 version after checking for the simple version. This way we get -Wfallhrough with clang and -Wfallthrough -Wfallthrough=5 with GCC, which works. --- diff --git a/meson.build b/meson.build index 65bf0b20af..4fbbb2f539 100644 --- a/meson.build +++ b/meson.build @@ -298,7 +298,8 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' 'array-bounds', 'empty-body', 'implicit', - 'implicit-fallthrough', + 'implicit-fallthrough', # For non-gcc + 'implicit-fallthrough=5', # For GCC, only recognize the attribute and no comments 'init-self', 'int-to-pointer-cast', 'main',