]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Document why -Wimplicit-fallthrough is not used with clang 23542/head
authorJan Janssen <medhefgo@web.de>
Sat, 28 May 2022 09:41:10 +0000 (11:41 +0200)
committerJan Janssen <medhefgo@web.de>
Sat, 28 May 2022 10:44:08 +0000 (12:44 +0200)
This changes the macro to ensure proper fallthrough attributes are
used with clang in case this option is added in the future.

meson.build
src/fundamental/macro-fundamental.h

index f416b4f234b38df241b9b5b657761e5cebe7a3ed..38ebe509f64c82332e91ec797a17147208b1fa03 100644 (file)
@@ -351,6 +351,9 @@ possible_common_cc_flags = [
         '-Werror=shift-overflow=2',
         '-Werror=undef',
         '-Wfloat-equal',
+        # gperf prevents us from enabling this because it does not emit fallthrough
+        # attribute with clang.
+        #'-Wimplicit-fallthrough',
         '-Wimplicit-fallthrough=5',
         '-Winit-self',
         '-Wlogical-op',
index eb43cf3647c86b003e15bcd4af2bf5e8e417a712..59d63e8e5dac6e906d0ab516fb636ff6c40e6d50 100644 (file)
@@ -40,7 +40,7 @@
 #  define _alloc_(...) __attribute__((__alloc_size__(__VA_ARGS__)))
 #endif
 
-#if __GNUC__ >= 7
+#if __GNUC__ >= 7 || __clang__
 #  define _fallthrough_ __attribute__((__fallthrough__))
 #else
 #  define _fallthrough_