From 864ca435655273c773055213f033ba621a9f9b17 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 31 Oct 2020 08:30:59 -0400 Subject: [PATCH] gdbsupport: replace AC_TRY_COMPILE in warning.m4 Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE + AC_LANG_PROGRAM. All changes in generated configure files are insignificant whitespace changes. gdb/ChangeLog: * configure: Re-generate. gdbserver/ChangeLog: * configure: Re-generate. gdbsupport/ChangeLog: * configure: Re-generate. * warning.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE + AC_LANG_PROGRAM. Change-Id: I517bd20ec3af960ad999a586761df0ac8959a3fc --- gdb/ChangeLog | 4 ++++ gdb/configure | 7 ++++--- gdbserver/ChangeLog | 4 ++++ gdbserver/configure | 7 ++++--- gdbsupport/ChangeLog | 6 ++++++ gdbsupport/configure | 7 ++++--- gdbsupport/warning.m4 | 24 ++++++++++++++++-------- 7 files changed, 42 insertions(+), 17 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 46e1302069..d9484b71bc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -6,6 +6,10 @@ * configure: Re-generate. +2020-10-31 Simon Marchi + + * configure: Re-generate. + 2020-10-31 Simon Marchi * acinclude.m4: Modernize. diff --git a/gdb/configure b/gdb/configure index 65904baf80..801e7a152e 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16563,13 +16563,14 @@ $as_echo_n "checking compiler warning flags... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ struct scoped_restore_base {}; - struct scoped_restore_tmpl : public scoped_restore_base { - ~scoped_restore_tmpl() {} - }; + struct scoped_restore_tmpl : public scoped_restore_base { + ~scoped_restore_tmpl() {} + }; int main () { const scoped_restore_base &b = scoped_restore_tmpl(); + ; return 0; } diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog index 8975cc9140..5da03da286 100644 --- a/gdbserver/ChangeLog +++ b/gdbserver/ChangeLog @@ -6,6 +6,10 @@ * configure: Re-generate. +2020-10-31 Simon Marchi + + * configure: Re-generate. + 2020-10-31 Simon Marchi * configure.ac: Modernize. diff --git a/gdbserver/configure b/gdbserver/configure index 3980ae7623..39ec4916df 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -9820,13 +9820,14 @@ $as_echo_n "checking compiler warning flags... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ struct scoped_restore_base {}; - struct scoped_restore_tmpl : public scoped_restore_base { - ~scoped_restore_tmpl() {} - }; + struct scoped_restore_tmpl : public scoped_restore_base { + ~scoped_restore_tmpl() {} + }; int main () { const scoped_restore_base &b = scoped_restore_tmpl(); + ; return 0; } diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog index 634b7c7913..1f4f4a2b4c 100644 --- a/gdbsupport/ChangeLog +++ b/gdbsupport/ChangeLog @@ -1,3 +1,9 @@ +2020-10-31 Simon Marchi + + * configure: Re-generate. + * warning.m4: Replace AC_TRY_COMPILE with AC_COMPILE_IFELSE + + AC_LANG_PROGRAM. + 2020-10-31 Simon Marchi * configure: Re-generate. diff --git a/gdbsupport/configure b/gdbsupport/configure index 904403d13f..1452b350ae 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -10306,13 +10306,14 @@ $as_echo_n "checking compiler warning flags... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ struct scoped_restore_base {}; - struct scoped_restore_tmpl : public scoped_restore_base { - ~scoped_restore_tmpl() {} - }; + struct scoped_restore_tmpl : public scoped_restore_base { + ~scoped_restore_tmpl() {} + }; int main () { const scoped_restore_base &b = scoped_restore_tmpl(); + ; return 0; } diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4 index 649be7552d..c88d4c65a0 100644 --- a/gdbsupport/warning.m4 +++ b/gdbsupport/warning.m4 @@ -139,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" -- 2.34.1