GCC expects -Wformat
to be passed with -Wformat-security
, which means
when we test for it in configure it currently fails:
0checking whether C++ compiler accepts -Wformat-security... no
1...
2configure:15907: checking whether C++ compiler accepts -Wformat-security
3configure:15926: g++ -std=c++11 -c -g -O2 -Werror -Wformat-security conftest.cpp >&5
4cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]
5cc1plus: all warnings being treated as errors
and never gets added to our CXX flags. Note that Clang does not have this requirement and the check is working correctly there.
The change in this PR is the simple fix, however we might want to consider using something like -Wformat=2
in future, which in GCC is equivalent to -Wformat -Wformat-nonliteral -Wformat-security -Wformat-y2k.
and similar in Clang.