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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-06-09 13:12:52 +02:00 committed by Filipe Brandenburger
parent b5cbe199c7
commit b05ecb8cad
1 changed files with 1 additions and 0 deletions

View File

@ -319,6 +319,7 @@ possible_cc_flags = [
'-Wstrict-aliasing=2',
'-Wwrite-strings',
'-Werror=overflow',
'-Werror=shift-count-overflow',
'-Wdate-time',
'-Wnested-externs',
'-ffast-math',