Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] gdb: fix typos in configure
@ 2021-11-27 19:34 Simon Marchi via Gdb-patches
  2021-11-27 20:35 ` Tom de Vries via Gdb-patches
  2021-11-27 23:03 ` Andreas Schwab
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Marchi via Gdb-patches @ 2021-11-27 19:34 UTC (permalink / raw)
  To: gdb-patches

The variable names used to restore CFLAGS and LDFLAGS here don't quite
match the names used above, resulting in losing the original CFLAGS and
LDFLAGS.  Fix that.

Change-Id: I9cc2c3b48b1dc30c31a7143563c893fd6f426a0a
---
 gdb/configure    | 8 ++++----
 gdb/configure.ac | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 90c1e3d7948b..448167f3c6d9 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -12138,8 +12138,8 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-      save_CFLAGS=$CFLAGS
-      save_LDFLAGS=$LDFLAGS
+      save_CFLAGS="$CFLAGS"
+      save_LDFLAGS="$LDFLAGS"
       CFLAGS="$CFLAGS $srchigh_pkg_cflags"
       LDFLAGS="$LDFLAGS $srchigh_pkg_libs"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12163,8 +12163,8 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-      CFLAGS="$SAVE_CFLAGS"
-      LDFLAGS="$SAVE_LDFLAGS"
+      CFLAGS="$save_CFLAGS"
+      LDFLAGS="$save_LDFLAGS"
       ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 29c1c4589c95..ada937316d73 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1265,8 +1265,8 @@ either use --disable-source-highlight or dnl
       # This situation can occur for instance when using a source highlight
       # library compiled with g++ 7.5.0 while building gdb with g++ 4.8.5.
       AC_LANG_PUSH(C++)
-      save_CFLAGS=$CFLAGS
-      save_LDFLAGS=$LDFLAGS
+      save_CFLAGS="$CFLAGS"
+      save_LDFLAGS="$LDFLAGS"
       CFLAGS="$CFLAGS $srchigh_pkg_cflags"
       LDFLAGS="$LDFLAGS $srchigh_pkg_libs"
       AC_LINK_IFELSE(
@@ -1278,8 +1278,8 @@ either use --disable-source-highlight or dnl
         [have_usable_source_highlight=yes],
         [have_usable_source_highlight=no]
       )
-      CFLAGS="$SAVE_CFLAGS"
-      LDFLAGS="$SAVE_LDFLAGS"
+      CFLAGS="$save_CFLAGS"
+      LDFLAGS="$save_LDFLAGS"
       AC_LANG_POP(C++)
 
       if test "${have_usable_source_highlight}" = "yes"; then
-- 
2.33.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pushed] gdb: fix typos in configure
  2021-11-27 19:34 [pushed] gdb: fix typos in configure Simon Marchi via Gdb-patches
@ 2021-11-27 20:35 ` Tom de Vries via Gdb-patches
  2021-11-28  0:35   ` Simon Marchi via Gdb-patches
  2021-11-27 23:03 ` Andreas Schwab
  1 sibling, 1 reply; 4+ messages in thread
From: Tom de Vries via Gdb-patches @ 2021-11-27 20:35 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 11/27/21 8:34 PM, Simon Marchi via Gdb-patches wrote:
> The variable names used to restore CFLAGS and LDFLAGS here don't quite
> match the names used above, resulting in losing the original CFLAGS and
> LDFLAGS.  Fix that.
> 

Hi Simon,

thanks for fixing this mistake in my patch.

Trying to understand what I could have done to catch his, I tried
shellcheck:
...
$ shellcheck src/gdb/configure 2>&1 | grep -i save
      save_CFLAGS=$CFLAGS
      ^---------^ SC2034: save_CFLAGS appears unused. Verify use (or
export if used externally).
      save_LDFLAGS=$LDFLAGS
      ^----------^ SC2034: save_LDFLAGS appears unused. Verify use (or
export if used externally).
      CFLAGS="$SAVE_CFLAGS"
              ^----------^ SC2153: Possible misspelling: SAVE_CFLAGS may
not be assigned, but save_CFLAGS is.
...
and indeed the problem was found.

I'll try to use that next time I'll do a configure update.

Thanks,
- Tom


> Change-Id: I9cc2c3b48b1dc30c31a7143563c893fd6f426a0a
> ---
>  gdb/configure    | 8 ++++----
>  gdb/configure.ac | 8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/gdb/configure b/gdb/configure
> index 90c1e3d7948b..448167f3c6d9 100755
> --- a/gdb/configure
> +++ b/gdb/configure
> @@ -12138,8 +12138,8 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
>  ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
>  ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
>  
> -      save_CFLAGS=$CFLAGS
> -      save_LDFLAGS=$LDFLAGS
> +      save_CFLAGS="$CFLAGS"
> +      save_LDFLAGS="$LDFLAGS"
>        CFLAGS="$CFLAGS $srchigh_pkg_cflags"
>        LDFLAGS="$LDFLAGS $srchigh_pkg_libs"
>        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> @@ -12163,8 +12163,8 @@ else
>  fi
>  rm -f core conftest.err conftest.$ac_objext \
>      conftest$ac_exeext conftest.$ac_ext
> -      CFLAGS="$SAVE_CFLAGS"
> -      LDFLAGS="$SAVE_LDFLAGS"
> +      CFLAGS="$save_CFLAGS"
> +      LDFLAGS="$save_LDFLAGS"
>        ac_ext=c
>  ac_cpp='$CPP $CPPFLAGS'
>  ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 29c1c4589c95..ada937316d73 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -1265,8 +1265,8 @@ either use --disable-source-highlight or dnl
>        # This situation can occur for instance when using a source highlight
>        # library compiled with g++ 7.5.0 while building gdb with g++ 4.8.5.
>        AC_LANG_PUSH(C++)
> -      save_CFLAGS=$CFLAGS
> -      save_LDFLAGS=$LDFLAGS
> +      save_CFLAGS="$CFLAGS"
> +      save_LDFLAGS="$LDFLAGS"
>        CFLAGS="$CFLAGS $srchigh_pkg_cflags"
>        LDFLAGS="$LDFLAGS $srchigh_pkg_libs"
>        AC_LINK_IFELSE(
> @@ -1278,8 +1278,8 @@ either use --disable-source-highlight or dnl
>          [have_usable_source_highlight=yes],
>          [have_usable_source_highlight=no]
>        )
> -      CFLAGS="$SAVE_CFLAGS"
> -      LDFLAGS="$SAVE_LDFLAGS"
> +      CFLAGS="$save_CFLAGS"
> +      LDFLAGS="$save_LDFLAGS"
>        AC_LANG_POP(C++)
>  
>        if test "${have_usable_source_highlight}" = "yes"; then
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pushed] gdb: fix typos in configure
  2021-11-27 19:34 [pushed] gdb: fix typos in configure Simon Marchi via Gdb-patches
  2021-11-27 20:35 ` Tom de Vries via Gdb-patches
@ 2021-11-27 23:03 ` Andreas Schwab
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2021-11-27 23:03 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches

On Nov 27 2021, Simon Marchi via Gdb-patches wrote:

> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 29c1c4589c95..ada937316d73 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -1265,8 +1265,8 @@ either use --disable-source-highlight or dnl
>        # This situation can occur for instance when using a source highlight
>        # library compiled with g++ 7.5.0 while building gdb with g++ 4.8.5.
>        AC_LANG_PUSH(C++)
> -      save_CFLAGS=$CFLAGS
> -      save_LDFLAGS=$LDFLAGS
> +      save_CFLAGS="$CFLAGS"
> +      save_LDFLAGS="$LDFLAGS"

That part is not needed, though.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pushed] gdb: fix typos in configure
  2021-11-27 20:35 ` Tom de Vries via Gdb-patches
@ 2021-11-28  0:35   ` Simon Marchi via Gdb-patches
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi via Gdb-patches @ 2021-11-28  0:35 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 2021-11-27 15:35, Tom de Vries wrote:
> On 11/27/21 8:34 PM, Simon Marchi via Gdb-patches wrote:
>> The variable names used to restore CFLAGS and LDFLAGS here don't quite
>> match the names used above, resulting in losing the original CFLAGS and
>> LDFLAGS.  Fix that.
>>
> 
> Hi Simon,
> 
> thanks for fixing this mistake in my patch.
> 
> Trying to understand what I could have done to catch his, I tried
> shellcheck:
> ...
> $ shellcheck src/gdb/configure 2>&1 | grep -i save
>       save_CFLAGS=$CFLAGS
>       ^---------^ SC2034: save_CFLAGS appears unused. Verify use (or
> export if used externally).
>       save_LDFLAGS=$LDFLAGS
>       ^----------^ SC2034: save_LDFLAGS appears unused. Verify use (or
> export if used externally).
>       CFLAGS="$SAVE_CFLAGS"
>               ^----------^ SC2153: Possible misspelling: SAVE_CFLAGS may
> not be assigned, but save_CFLAGS is.
> ...
> and indeed the problem was found.
> 
> I'll try to use that next time I'll do a configure update.
> 
> Thanks,
> - Tom

I think shellcheck is great, but it's not so easy to use it on a
generated file that produces a ton of warnings already.

Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-28  0:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 19:34 [pushed] gdb: fix typos in configure Simon Marchi via Gdb-patches
2021-11-27 20:35 ` Tom de Vries via Gdb-patches
2021-11-28  0:35   ` Simon Marchi via Gdb-patches
2021-11-27 23:03 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox