]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
gdb: fix shellcheck warnings SC2154 (referenced but not assigned) in gdbarch.sh
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 30 Apr 2020 00:35:35 +0000 (20:35 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 30 Apr 2020 00:35:35 +0000 (20:35 -0400)
commit1207375d768ae2b901c3bea6543b610c461160dd
tree991dfa144424ce31efa350615e048929478f1f65
parent9fdb2916fec2833fd5c359c35916d2e632a06c23
gdb: fix shellcheck warnings SC2154 (referenced but not assigned) in gdbarch.sh

Fix all instances of this kind of warning:

    In gdbarch.sh line 96:
                    m ) staticdefault="${predefault}" ;;
                                       ^-----------^ SC2154: predefault is referenced but not assigned.

These warnings appear because we are doing something a bit funky when reading
the gdbarch fields.  These variables are not assigned explicitly, but
using some `eval` commands.

I don't think there is so much we can fix about those warnings.  To
silence them, I've changed `${foo}` to `${foo:-}`.  This tells the shell
to substitute with an empty string if `foo` is not defined.  This
retains the current behavior, but the warnings go away.

gdb/ChangeLog:

* gdbarch.sh: Use ${foo:-} where shellcheck would report a
"referenced but not assigned" warning.
gdb/ChangeLog
gdb/gdbarch.sh