]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: fix shellcheck warnings SC2034 (unused variable) 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)
shellcheck reports:

    In gdbarch.sh line 139:
                    fallbackdefault="0"
                    ^-------------^ SC2034: fallbackdefault appears unused. Verify use (or export if used externally).

Indeed, the `fallbackdefault` variable appears to be unused, remove the
code that sets it.

gdb/ChangeLog:

* gdbarch.sh: Remove code that sets fallbackdefault.

gdb/ChangeLog
gdb/gdbarch.sh

index bf0fdf55a5c3a5f1c88f5c46818a12b507713a64..dee9a6edd3b421e200f7a0634278d65f1853e2a0 100644 (file)
@@ -1,3 +1,7 @@
+2020-04-29  Simon Marchi  <simon.marchi@efficios.com>
+
+       * gdbarch.sh: Remove code that sets fallbackdefault.
+
 2020-04-29  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbarch.sh: Use shell operators && and || instead of
index f1b9276775e313910a7215d511a9577cc227534c..4e4cc827b895ccbd518130007ebbd14b65584a54 100755 (executable)
@@ -122,23 +122,6 @@ EOF
                esac
            esac
 
-           # PREDEFAULT is a valid fallback definition of MEMBER when
-           # multi-arch is not enabled.  This ensures that the
-           # default value, when multi-arch is the same as the
-           # default value when not multi-arch.  POSTDEFAULT is
-           # always a valid definition of MEMBER as this again
-           # ensures consistency.
-
-           if [ -n "${postdefault}" ]
-           then
-               fallbackdefault="${postdefault}"
-           elif [ -n "${predefault}" ]
-           then
-               fallbackdefault="${predefault}"
-           else
-               fallbackdefault="0"
-           fi
-
            #NOT YET: See gdbarch.log for basic verification of
            # database
 
@@ -156,8 +139,8 @@ EOF
 
 fallback_default_p ()
 {
-    ( [ -n "${postdefault}" ] && [ "x${invalid_p}" != "x0" ] ) \
-       || ( [ -n "${predefault}" ] && [ "x${invalid_p}" = "x0" ] )
+    { [ -n "${postdefault}" ] && [ "x${invalid_p}" != "x0" ]; } \
+       || { [ -n "${predefault}" ] && [ "x${invalid_p}" = "x0" ]; }
 }
 
 class_is_variable_p ()