chiark / gitweb /
meson: do not allow bit-shift overflows
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 9 Jun 2018 11:12:52 +0000 (13:12 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commitec4b18ddb9cc1df4ac410614308c6f520d6c6c81
treebdda9a779eeba8a0f3310141a42655b4e8ff87df
parent851be93e91cfcb9de7e7a3e27503244ba4072e97
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.
meson.build