2021-05-24 15:54:32 +02:00
|
|
|
From 32768d3cc8cecbc30d9020dbfa8d9ec541d057e4 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Evangelos Foutras <evangelos@foutrelis.com>
|
|
|
|
Date: Wed, 17 Mar 2021 16:36:40 +0200
|
|
|
|
Subject: [PATCH] Replace YYUSE call with void cast in src/parser.y
|
|
|
|
|
|
|
|
The YYUSE macro was renamed to YY_USE in bison 3.7.5; we might as well
|
|
|
|
avoid using it altogether and cast the unused variable to void instead.
|
|
|
|
|
|
|
|
Fixes the following linker error:
|
|
|
|
|
|
|
|
/usr/bin/ld: kafel/libkafel.a(libkafel.o): in function `kafel_yyerror':
|
|
|
|
arm_syscalls.c:(.text+0x6984): undefined reference to `YYUSE'
|
|
|
|
---
|
|
|
|
src/parser.y | 2 +-
|
|
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git kafel/src/parser.y kafel/src/parser.y
|
|
|
|
index e0f109c..0e01373 100644
|
srcpkgs/n*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
for p in ${template%/template}/patches/*; do
sed -i '
\,^[+-][+-][+-] /dev/null,b
/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
s,^[*][*][*] ,&a/,
/^--- /{
s,\(^--- \)\(./\)*,\1a/,
s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1,
s/[.-][Oo][Rr][Ii][Gg]$//
s/[.]patched[.]\([^.]\)/.\1/
h
}
/^+++ -/{
g
s/^--- a/+++ b/
b
}
s,\(^+++ \)\(./\)*,\1b/,
' "$p"
done
sed -i '/^patch_args=/d' $template
done
```
2021-06-19 05:03:21 +02:00
|
|
|
--- a/kafel/src/parser.y
|
|
|
|
+++ b/kafel/src/parser.y
|
2021-05-24 15:54:32 +02:00
|
|
|
@@ -420,8 +420,8 @@ const_def
|
|
|
|
|
|
|
|
void yyerror(YYLTYPE * loc, struct kafel_ctxt* ctxt, yyscan_t scanner,
|
|
|
|
const char *msg) {
|
|
|
|
+ (void)scanner; /* suppress unused-parameter warning */
|
|
|
|
if (!ctxt->lexical_error) {
|
|
|
|
- YYUSE(scanner);
|
|
|
|
if (loc->filename != NULL) {
|
|
|
|
append_error(ctxt, "%s:%d:%d: %s", loc->filename, loc->first_line, loc->first_column, msg);
|
|
|
|
} else {
|