bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tests: fix maintainer-check-g++ make recipe


From: Akim Demaille
Subject: tests: fix maintainer-check-g++ make recipe
Date: Thu, 6 Sep 2018 21:31:47 +0200

Actually, it’s more « make it compatible with clang ».

commit 2c29a70819b79e343fa292c549975bdc7ae720b8
Author: Akim Demaille <address@hidden>
Date:   Thu Sep 6 18:06:58 2018 +0200

    tests: fix maintainer-check-g++ make recipe
    
    Clang++ issues warnings when it's used to compile C.  This make target
    is precisely checking whether we can do that.
    
    * configure.ac (NO_DEPRECATED_CXXFLAGS): New.
    * tests/atlocal.in: Use it.

diff --git a/configure.ac b/configure.ac
index 1a9dcb00..cc601d3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,6 +154,8 @@ if test "$enable_gcc_warnings" = yes; then
   gl_WARN_ADD([-Wno-zero-as-null-pointer-constant], [FLEX_SCANNER_CXXFLAGS])
   CXXFLAGS=$save_CXXFLAGS
   gl_WARN_ADD([-fno-exceptions], [CXXFLAGS_NO_EXCEPTIONS])
+  # Clang++ deprecates compiling C.
+  gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS])
   AC_LANG_POP([C++])
 fi
 
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 93ba7613..00cb92c9 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -42,6 +42,7 @@ GCC='@GCC@'
 # sets CFLAGS to this.
   NO_WERROR_CFLAGS='@CFLAGS@   @WARN_CFLAGS@   @WARN_CFLAGS_TEST@'
 NO_WERROR_CXXFLAGS='@CXXFLAGS@ @WARN_CXXFLAGS@ @WARN_CXXFLAGS_TEST@'
+WNO_DEPRECATED_CXXFLAGS='@WNO_DEPRECATED_CXXFLAGS@'
 
 # But most of the time, we want -Werror.
   CFLAGS="$NO_WERROR_CFLAGS   @WERROR_CFLAGS@"
@@ -99,7 +100,7 @@ if "$at_arg_compile_c_with_cxx"; then
   CC_IS_CXX=1
   CC=$CXX
   NO_WERROR_CFLAGS=$NO_WERROR_CXXFLAGS
-  CFLAGS=$CXXFLAGS
+  CFLAGS="$CXXFLAGS $WNO_DEPRECATED_CXXFLAGS"
   BISON_C_WORKS=$BISON_CXX_WORKS
 else
   CC_IS_CXX=0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]