Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] [gdb/contrib] Make cc-with-tweaks.sh shellcheck-clean
@ 2026-08-31  9:11 Tom de Vries
  2026-09-01 16:25 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2026-08-31  9:11 UTC (permalink / raw)
  To: gdb-patches

Make gdb/contrib/cc-with-tweaks.sh shellcheck-clean by adding some quotes.
---
 gdb/contrib/cc-with-tweaks.sh | 2 +-
 gdb/contrib/shellcheck.sh     | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
index 57fd51354bc..047c748e165 100755
--- a/gdb/contrib/cc-with-tweaks.sh
+++ b/gdb/contrib/cc-with-tweaks.sh
@@ -335,4 +335,4 @@ if [ "$want_gnu_debuglink" = true ]; then
     [ $rc != 0 ] && exit $rc
 fi
 
-exit $rc
+exit "$rc"
diff --git a/gdb/contrib/shellcheck.sh b/gdb/contrib/shellcheck.sh
index a3e80a553f4..2a0425eeaab 100755
--- a/gdb/contrib/shellcheck.sh
+++ b/gdb/contrib/shellcheck.sh
@@ -43,7 +43,6 @@ for f in "$@"; do
 	    ;;
 	gdb/config/djgpp/djcheck.sh \
 	    | gdb/config/djgpp/djconfig.sh \
-	    | gdb/contrib/cc-with-tweaks.sh \
 	    | gdb/contrib/gdb-add-index.sh \
 	    | gdb/gdb_buildall.sh \
 	    | gdb/gdb_mbuild.sh \

base-commit: 60af72593d95acc71b45e570abcf53c0185656b4
-- 
2.51.0


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

* Re: [pushed] [gdb/contrib] Make cc-with-tweaks.sh shellcheck-clean
  2026-08-31  9:11 [pushed] [gdb/contrib] Make cc-with-tweaks.sh shellcheck-clean Tom de Vries
@ 2026-09-01 16:25 ` Tom Tromey
  2026-09-01 16:29   ` Tom de Vries
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2026-09-01 16:25 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> Make gdb/contrib/cc-with-tweaks.sh shellcheck-clean by adding some quotes.

Tom> diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
Tom> index 57fd51354bc..047c748e165 100755
Tom> --- a/gdb/contrib/cc-with-tweaks.sh
Tom> +++ b/gdb/contrib/cc-with-tweaks.sh
Tom> @@ -335,4 +335,4 @@ if [ "$want_gnu_debuglink" = true ]; then
Tom>      [ $rc != 0 ] && exit $rc
Tom>  fi
 
Tom> -exit $rc
Tom> +exit "$rc"

I wonder why the quotes are needed here but not in the quoted line
above.

Tom

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

* Re: [pushed] [gdb/contrib] Make cc-with-tweaks.sh shellcheck-clean
  2026-09-01 16:25 ` Tom Tromey
@ 2026-09-01 16:29   ` Tom de Vries
  2026-09-02 19:22     ` Tom de Vries
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2026-09-01 16:29 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 9/1/26 6:25 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> Make gdb/contrib/cc-with-tweaks.sh shellcheck-clean by adding some quotes.
> 
> Tom> diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
> Tom> index 57fd51354bc..047c748e165 100755
> Tom> --- a/gdb/contrib/cc-with-tweaks.sh
> Tom> +++ b/gdb/contrib/cc-with-tweaks.sh
> Tom> @@ -335,4 +335,4 @@ if [ "$want_gnu_debuglink" = true ]; then
> Tom>      [ $rc != 0 ] && exit $rc
> Tom>  fi
>   
> Tom> -exit $rc
> Tom> +exit "$rc"
> 
> I wonder why the quotes are needed here but not in the quoted line
> above.

The def that reaches this use is:
...
     rc=${PIPESTATUS[0]}
...
and shellcheck doesn't treat that specially, at least in the context of 
this check.

Thanks,
- Tom

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

* Re: [pushed] [gdb/contrib] Make cc-with-tweaks.sh shellcheck-clean
  2026-09-01 16:29   ` Tom de Vries
@ 2026-09-02 19:22     ` Tom de Vries
  0 siblings, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2026-09-02 19:22 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 9/1/26 6:29 PM, Tom de Vries wrote:
> On 9/1/26 6:25 PM, Tom Tromey wrote:
>>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>>
>> Tom> Make gdb/contrib/cc-with-tweaks.sh shellcheck-clean by adding 
>> some quotes.
>>
>> Tom> diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with- 
>> tweaks.sh
>> Tom> index 57fd51354bc..047c748e165 100755
>> Tom> --- a/gdb/contrib/cc-with-tweaks.sh
>> Tom> +++ b/gdb/contrib/cc-with-tweaks.sh
>> Tom> @@ -335,4 +335,4 @@ if [ "$want_gnu_debuglink" = true ]; then
>> Tom>      [ $rc != 0 ] && exit $rc
>> Tom>  fi
>> Tom> -exit $rc
>> Tom> +exit "$rc"
>>
>> I wonder why the quotes are needed here but not in the quoted line
>> above.
> 
> The def that reaches this use is:
> ...
>      rc=${PIPESTATUS[0]}
> ...
> and shellcheck doesn't treat that specially, at least in the context of 
> this check.

To be precise, one of the reaching definitions.

But anyway, I've submitted a patch that removes this exit entirely ( 
https://sourceware.org/pipermail/gdb-patches/2026-September/229974.html ).

Thanks,
- Tom

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

end of thread, other threads:[~2026-09-02 19:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-31  9:11 [pushed] [gdb/contrib] Make cc-with-tweaks.sh shellcheck-clean Tom de Vries
2026-09-01 16:25 ` Tom Tromey
2026-09-01 16:29   ` Tom de Vries
2026-09-02 19:22     ` Tom de Vries

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