]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: Makefile: shut certain gcc/clang stupid warnings
authorWilly Tarreau <w@1wt.eu>
Wed, 13 Sep 2017 14:58:27 +0000 (16:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Sep 2017 15:10:44 +0000 (17:10 +0200)
commit065843c8767cd7851637b517990221709116b848
tree45136064047cf53611e5c6d1a04deb661b5ddcca
parentd3a7f40359e59a0c44e929efa91761ad21d38167
BUILD: Makefile: shut certain gcc/clang stupid warnings

The recent gcc and clang are utterly broken and apparently written by
people who don't use them anymore, because they emit warnings that are
impossible to disable in the code, which is the opposite of what a
warning should do. It is however possible to disable these warnings on
the command line.

This patch adds when supported :
   -Wno-format-truncation: bogus warning which is triggered on each
    snprintf() call based on the input type instead of the variables
    ranges, resulting in the impossibility to use "%02d" and similar.

   -Wno-address-of-packed-member: emitted for each and every line in
    ebtree.h by recent clang. Probably that the warning's author has
    never understood the use cases of packed structs and should be
    taught the use cases of the language he writes the compiler for.

   -Wno-null-dereference: emitted by clang on *(int *)0 = 0. The code
    will be updated to use a volatile instead but this recent change
    of behaviour will certainly cause quite some bugs in decades of
    existing code.

Feel free to report new such stupid warnings and to propose patches
to complete this list.
Makefile