1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

meson: Document why -Wimplicit-fallthrough is not used with clang

This changes the macro to ensure proper fallthrough attributes are
used with clang in case this option is added in the future.
This commit is contained in:
Jan Janssen 2022-05-28 11:41:10 +02:00
parent b41ebe3d18
commit c0f5d58c9a
2 changed files with 4 additions and 1 deletions

View 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',

View 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_