]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Add -Wformat -Wformat-security to the list of compile flags.
authorFlorian Krohm <florian@eich-krohm.de>
Wed, 3 Dec 2014 22:53:00 +0000 (22:53 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Wed, 3 Dec 2014 22:53:00 +0000 (22:53 +0000)
commitf38d96dd61c0a56ffb7367311d7e7db5e9b0a681
tree740a131681e0ebd2289c955c07e97d2ae8cc2570
parentd7811e3de704dc12d225fdb255ce66b2373b10de
Add -Wformat -Wformat-security to the list of compile flags.
This was not as straight forward as expected. Specifically, adding the
new flag to CFLAGS in configure.ac did not work and was causing
compiler warnings. For instance, compiling memcheck/tests/execve2.c will
generate a -Wnonnull warning even though the testcase is explicitly
compiled with -Wno-nonnull. The reason is that (a) -Wformat is implied by
-Wnonnull and (b) the list of compiler flags gets assembled in the wrong
order. The culprit appears to be that we modify CFLAGS in configure.ac and
that really is not the right place. Conceptually, configure should determine
tool-chain capabilities and not assemble compiler flags. That should be done
in Makefiles. This patch entangles all this.

So, whatever was added to CFLAGS in configure.ac has now been moved to
Makefile.all.am and Makefile.tool-tests.am. Those are:
-Wno-long-long
-Wwrite-strings
-Wcast-qual
-fno-stack-protector
Note, that this change allows us to simplify Makefile.tool-tests.am which
in the past was disabling some of those flags (e.g. by adding -Wno-cast-qual
again).
In case of the clang compiler, extra command line options are needed. I've
moved those into a separate 'if COMPILER_IS_CLANG' section and not merge
them into baseline flags.

Related to BZ 334727.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14798
Makefile.all.am
Makefile.tool-tests.am
configure.ac
memcheck/tests/vbit-test/Makefile.am