chiark / gitweb /
3ea836fbfb85eb1e0315fff68db83b866dffc6c6
[gnupg2.git] / patches / 0016-build-Enable-gcc-warnings-to-detect-non-portable-cod.patch
1 From: Werner Koch <wk@gnupg.org>
2 Date: Mon, 2 Jan 2017 12:59:10 +0100
3 Subject: build: Enable gcc warnings to detect non-portable code.
4
5 --
6
7 Signed-off-by: Werner Koch <wk@gnupg.org>
8 (cherry picked from commit c52930d11fcc52515fcc09a1085bf118411566a8)
9 ---
10  configure.ac | 9 +++++++++
11  1 file changed, 9 insertions(+)
12
13 diff --git a/configure.ac b/configure.ac
14 index 932c741ef..237189cf9 100644
15 --- a/configure.ac
16 +++ b/configure.ac
17 @@ -1575,6 +1575,15 @@ if test "$GCC" = yes; then
18          if test x"$_gcc_wopt" = xyes ; then
19            mycflags="$mycflags -Wdeclaration-after-statement"
20          fi
21 +
22 +        AC_MSG_CHECKING([if gcc supports -Wlogical-op and -Wvla])
23 +        CFLAGS="-Wlogical-op -Wvla"
24 +        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
25 +        AC_MSG_RESULT($_gcc_wopt)
26 +        if test x"$_gcc_wopt" = xyes ; then
27 +          mycflags="$mycflags -Wlogical-op -Wvla"
28 +        fi
29 +
30      else
31          mycflags="$mycflags -Wall"
32      fi