gdb: fix shellcheck warnings SC2059 (variables in printf format string) in gdbarch.sh
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 30 Apr 2020 00:35:33 +0000 (20:35 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 30 Apr 2020 00:35:33 +0000 (20:35 -0400)
commit8d113d130ef87c982896412f89154a5fa5afc9ac
tree93c8f2b0a2b66da1a6d877c8d3e2250a8e23ffbc
parent84ed7a472551bce1ac58e0eced619433fabc956c
gdb: fix shellcheck warnings SC2059 (variables in printf format string) in gdbarch.sh

Fix all instances of this:

    In gdbarch.sh line 2182:
                printf "  gdb_assert (!(${invalid_p}));\n"
                       ^-- SC2059: Don't use variables in the printf format string. Use printf "..%s.." "$foo".

... by doing exactly as the message suggests.

The rationale explained here [1] makes sense, if there happens to be a
format specifier in text substituted for the variable, the printf won't
do what we expect.

[1] https://github.com/koalaman/shellcheck/wiki/SC2059

gdb/ChangeLog:

* gdbarch.sh: Use %s with printf, instead of variables in the
format string.
gdb/ChangeLog
gdb/gdbarch.sh
This page took 0.024842 seconds and 4 git commands to generate.