+2020-04-29 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbarch.sh: Use ${foo:-} where shellcheck would report a
+ "referenced but not assigned" warning.
+
2020-04-29 Simon Marchi <simon.marchi@efficios.com>
* gdbarch.sh: Remove code that sets fallbackdefault.
EOF
IFS="${OFS}"
- if test -n "${garbage_at_eol}"
+ if test -n "${garbage_at_eol:-}"
then
echo "Garbage at end-of-line in ${line}" 1>&2
kill $$
done
case "${class}" in
- m ) staticdefault="${predefault}" ;;
+ m ) staticdefault="${predefault:-}" ;;
M ) staticdefault="0" ;;
* ) test "${staticdefault}" || staticdefault=0 ;;
esac
case "${class}" in
F | V | M )
- case "${invalid_p}" in
+ case "${invalid_p:-}" in
"" )
if test -n "${predefault}"
then
#invalid_p="gdbarch->${function} == ${predefault}"
- predicate="gdbarch->${function} != ${predefault}"
+ predicate="gdbarch->${function:-} != ${predefault}"
elif class_is_variable_p
then
predicate="gdbarch->${function} != 0"
fallback_default_p ()
{
- { [ -n "${postdefault}" ] && [ "x${invalid_p}" != "x0" ]; } \
+ { [ -n "${postdefault:-}" ] && [ "x${invalid_p}" != "x0" ]; } \
|| { [ -n "${predefault}" ] && [ "x${invalid_p}" = "x0" ]; }
}
function_list | while do_read
do
cat <<EOF
-${class} ${returntype} ${function} ($formal)
+${class} ${returntype:-} ${function} (${formal:-})
EOF
for r in ${read}
do
fi
printf " if (gdbarch_debug >= 2)\n"
printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_%s called\\\\n\");\n" "$function"
- if [ "x${actual}" = "x-" ] || [ "x${actual}" = "x" ]
+ if [ "x${actual:-}" = "x-" ] || [ "x${actual:-}" = "x" ]
then
if class_is_multiarch_p
then