Fix test case gdb.base/valgrind-bt.exp.
[deliverable/binutils-gdb.git] / gdbsupport / warning.m4
index e2b8a43ddbd54b5900e388f3265b781ae241bf95..46036fa461e85089f595f615405184516d25e437 100644 (file)
@@ -1,5 +1,5 @@
 dnl Autoconf configure script for GDB, the GNU debugger.
-dnl Copyright (C) 1995-2020 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2021 Free Software Foundation, Inc.
 dnl
 dnl This file is part of GDB.
 dnl
@@ -50,7 +50,10 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
--Wmissing-declarations"
+-Wmissing-declarations \
+-Wmissing-prototypes \
+-Wstrict-null-sentinel \
+"
 
 case "${host}" in
   *-*-mingw32*)
@@ -136,15 +139,23 @@ then
              # Check for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38958,
              # fixed in GCC 4.9.  This test is derived from the gdb
              # source code that triggered this bug in GCC.
-             AC_TRY_COMPILE(
-               [struct scoped_restore_base {};
-                 struct scoped_restore_tmpl : public scoped_restore_base {
-                  ~scoped_restore_tmpl() {}
-                };],
-               [const scoped_restore_base &b = scoped_restore_tmpl();],
-               WARN_CFLAGS="${WARN_CFLAGS} $w",)
+             AC_COMPILE_IFELSE(
+               [AC_LANG_PROGRAM(
+                  [struct scoped_restore_base {};
+                   struct scoped_restore_tmpl : public scoped_restore_base {
+                     ~scoped_restore_tmpl() {}
+                   };],
+                  [const scoped_restore_base &b = scoped_restore_tmpl();]
+                )],
+               [WARN_CFLAGS="${WARN_CFLAGS} $w"],
+               []
+             )
            else
-             AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
+             AC_COMPILE_IFELSE(
+               [AC_LANG_PROGRAM([], [])],
+               [WARN_CFLAGS="${WARN_CFLAGS} $w"],
+               []
+             )
            fi
            CFLAGS="$saved_CFLAGS"
            CXXFLAGS="$saved_CXXFLAGS"
This page took 0.023351 seconds and 4 git commands to generate.