[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/22] examples: avoid "unbound variable" errors
From: |
Akim Demaille |
Subject: |
[PATCH 03/22] examples: avoid "unbound variable" errors |
Date: |
Sat, 23 Jan 2021 15:55:42 +0100 |
From: Martin Rehak <martin.rehak@oracle.com>
When the shell option `nounset` is set, we may get "unbound variable"
errors.
https://lists.gnu.org/r/bug-bison/2020-11/msg00013.html
* examples/test (diff_opts): Be sure to initialize it.
---
examples/test | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/test b/examples/test
index 810767014..7590e1281 100755
--- a/examples/test
+++ b/examples/test
@@ -37,6 +37,7 @@ strip_prompt=false
# If diff supports --strip-trailing-cr, use it, to avoid EOL issues
# when testing Java programs on Windows.
echo "checking for diff --strip-trailing-cr..."
+diff_opts=
if diff --strip-trailing-cr "$1" "$1"; then
diff_opts=--strip-trailing-cr
fi
--
2.30.0
- [PATCH 00/22] maint: prepare 3.7.5, Akim Demaille, 2021/01/23
- [PATCH 01/22] c: adjust _Noreturn to pedantic clang, Akim Demaille, 2021/01/23
- [PATCH 02/22] autoconf: update, Akim Demaille, 2021/01/23
- [PATCH 03/22] examples: avoid "unbound variable" errors,
Akim Demaille <=
- [PATCH 04/22] c++: use noexcept where appropriate, Akim Demaille, 2021/01/23
- [PATCH 05/22] tables: avoid warnings and save bits, Akim Demaille, 2021/01/23
- [PATCH 06/22] glr.cc: don't "leak" yyparse, Akim Demaille, 2021/01/23
- [PATCH 07/22] c++: I'm tired of Flex's warnings, Akim Demaille, 2021/01/23
- [PATCH 08/22] cex: send traces to stderr, not stdout, Akim Demaille, 2021/01/23
- [PATCH 09/22] cex: add support for $TIME_LIMIT, Akim Demaille, 2021/01/23
- [PATCH 10/22] cex: fix traces: add missing end-of-lines, Akim Demaille, 2021/01/23
- [PATCH 11/22] cex: fix traces: fix display of disabled items, Akim Demaille, 2021/01/23
- [PATCH 12/22] package: codespell, Akim Demaille, 2021/01/23
- [PATCH 13/22] style: YYUSE is private, make it YY_USE, Akim Demaille, 2021/01/23