From: Zbigniew Jędrzejewski-Szmek Date: Sat, 9 Jun 2018 11:12:52 +0000 (+0200) Subject: meson: do not allow bit-shift overflows X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ec4b18ddb9cc1df4ac410614308c6f520d6c6c81;p=elogind.git meson: do not allow bit-shift overflows The primary motivation is to catch enum values created through a shift that is too big: ../src/test/test-sizeof.c:26:29: error: left shift count >= width of type [-Werror=shift-count-overflow] enum_with_shift = 1 << 32, ^~ cc1: some warnings being treated as errors The compiler will now reject those. This is an alternative to #9224. --- diff --git a/meson.build b/meson.build index 1356ae996..fe014eda7 100644 --- a/meson.build +++ b/meson.build @@ -386,6 +386,7 @@ endif # '-Wstrict-aliasing=2', # '-Wwrite-strings', # '-Werror=overflow', +# '-Werror=shift-count-overflow', # '-Wdate-time', # '-Wnested-externs', # '-ffast-math', @@ -1927,6 +1928,7 @@ executable('elogind-user-runtime-dir', executable('elogind-user-runtime-dir', executable('elogind-user-runtime-dir', executable('elogind-user-runtime-dir', +executable('elogind-user-runtime-dir', executable('elogind-user-runtime-dir', user_runtime_dir_sources, include_directories : includes,