[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[automake-commit] branch master updated: tests: let yacc's yyerror take
From: |
Paul Eggert |
Subject: |
[automake-commit] branch master updated: tests: let yacc's yyerror take its argument as a const string |
Date: |
Sat, 11 Sep 2021 10:55:45 -0400 |
This is an automated email from the git hooks/post-receive script.
eggert pushed a commit to branch master
in repository automake.
View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=2bb6340fa9838b7c1ce2e7673c64e5e9840d59f1
The following commit(s) were added to refs/heads/master by this push:
new 2bb6340 tests: let yacc's yyerror take its argument as a const string
2bb6340 is described below
commit 2bb6340fa9838b7c1ce2e7673c64e5e9840d59f1
Author: Akim Demaille <akim@lrde.epita.fr>
AuthorDate: Sat Sep 11 10:06:13 2021 +0200
tests: let yacc's yyerror take its argument as a const string
Some of yacc error messages are const strings; it makes no sense for
yyerror to take a 'char *', it should be a 'const char *' as POSIX now
requires.
Fixes all the failures reported by Kiyoshi Kanazawa.
<https://lists.gnu.org/r/bug-bison/2021-09/msg00005.html>
See bug#50469 <https://debbugs.gnu.org/50469>.
* t/cond35.sh, t/silent-many-languages.sh, t/silent-yacc-headers.sh,
* t/silent-yacc.sh, t/subpkg-yacc.sh, t/suffix10.tap, t/yacc-basic.sh,
* t/yacc-clean.sh, t/yacc-d-basic.sh, t/yacc-d-vpath.sh,
* t/yacc-deleted-headers.sh, t/yacc-depend.sh, t/yacc-depend2.sh,
* t/yacc-dist-nobuild-subdir.sh, t/yacc-dist-nobuild.sh, t/yacc-dry.sh,
* t/yacc-line.sh, t/yacc-misc.sh, t/yacc-mix-c-cxx.sh, t/yacc-nodist.sh,
* t/yacc-pr204.sh, t/yacc-subdir.sh, t/yacc-vpath.sh,
* t/yflags-cmdline-override.sh, t/yflags-force-override.sh
(yyerror): From 'char *' to 'const char *'.
Enforce consistency: prefer '{}' to '{ return; }'.
---
t/cond35.sh | 2 +-
t/silent-many-languages.sh | 2 +-
t/silent-yacc-headers.sh | 2 +-
t/silent-yacc.sh | 2 +-
t/subpkg-yacc.sh | 2 +-
t/suffix10.tap | 2 +-
t/yacc-basic.sh | 2 +-
t/yacc-bison-skeleton.sh | 2 +-
t/yacc-clean-cxx.sh | 2 +-
t/yacc-clean.sh | 2 +-
t/yacc-cxx.sh | 2 +-
t/yacc-d-basic.sh | 2 +-
t/yacc-d-vpath.sh | 6 +++---
t/yacc-deleted-headers.sh | 4 ++--
t/yacc-depend.sh | 2 +-
t/yacc-depend2.sh | 2 +-
t/yacc-dist-nobuild-subdir.sh | 2 +-
t/yacc-dist-nobuild.sh | 2 +-
t/yacc-dry.sh | 2 +-
t/yacc-line.sh | 2 +-
t/yacc-misc.sh | 4 ++--
t/yacc-mix-c-cxx.sh | 6 +++---
t/yacc-nodist.sh | 2 +-
t/yacc-pr204.sh | 2 +-
t/yacc-subdir.sh | 2 +-
t/yacc-vpath.sh | 6 +++---
t/yflags-cmdline-override.sh | 2 +-
t/yflags-force-override.sh | 2 +-
28 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/t/cond35.sh b/t/cond35.sh
index 786bb3c..37a25ea 100644
--- a/t/cond35.sh
+++ b/t/cond35.sh
@@ -73,7 +73,7 @@ END
cat > tparse.y << 'END'
%{
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%token EOF
%%
diff --git a/t/silent-many-languages.sh b/t/silent-many-languages.sh
index edb59e7..9361b2b 100644
--- a/t/silent-many-languages.sh
+++ b/t/silent-many-languages.sh
@@ -188,7 +188,7 @@ EOF
cat > foo6.y <<'EOF'
%{
extern int yylex (void);
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%token EOF
%%
diff --git a/t/silent-yacc-headers.sh b/t/silent-yacc-headers.sh
index c10fc5c..0582973 100644
--- a/t/silent-yacc-headers.sh
+++ b/t/silent-yacc-headers.sh
@@ -39,7 +39,7 @@ EOF
cat > parse.y <<'EOF'
%{
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
int yylex (void) { return 0; }
int main (void) { return 0; }
%}
diff --git a/t/silent-yacc.sh b/t/silent-yacc.sh
index d11fc2a..3254d40 100644
--- a/t/silent-yacc.sh
+++ b/t/silent-yacc.sh
@@ -50,7 +50,7 @@ EOF
cat > foo.y <<'EOF'
%{
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
int yylex (void) { return 0; }
int main (void) { return 0; }
%}
diff --git a/t/subpkg-yacc.sh b/t/subpkg-yacc.sh
index eac56cb..9e31c51 100644
--- a/t/subpkg-yacc.sh
+++ b/t/subpkg-yacc.sh
@@ -88,7 +88,7 @@ EOF
cat > lib/foo.y << 'END'
%{
int yylex (void) { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/suffix10.tap b/t/suffix10.tap
index 2258120..d233c6c 100644
--- a/t/suffix10.tap
+++ b/t/suffix10.tap
@@ -39,7 +39,7 @@ libfoo_la_SOURCES = foo.x_
:; { echo '/* autogenerated */' \
&& echo '%{' \
&& echo 'int yylex () {return 0;}' \
- && echo 'void yyerror (char *s) {}' \
+ && echo 'void yyerror (const char *s) {}' \
&& echo '%}' \
&& echo '%%' \
&& echo "foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};" \
diff --git a/t/yacc-basic.sh b/t/yacc-basic.sh
index cfbaa19..d501570 100644
--- a/t/yacc-basic.sh
+++ b/t/yacc-basic.sh
@@ -42,7 +42,7 @@ cat > parse.y << 'END'
#include <stdio.h>
#include <stdlib.h>
int yylex () { return getchar (); }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
a : 'a' { exit(0); };
diff --git a/t/yacc-bison-skeleton.sh b/t/yacc-bison-skeleton.sh
index 60e85dd..6069489 100644
--- a/t/yacc-bison-skeleton.sh
+++ b/t/yacc-bison-skeleton.sh
@@ -44,7 +44,7 @@ void yyerror (const char *s);
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
%%
int yylex () { return 0; }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
END
cat > foo.c << 'END'
diff --git a/t/yacc-clean-cxx.sh b/t/yacc-clean-cxx.sh
index fe27958..811d469 100644
--- a/t/yacc-clean-cxx.sh
+++ b/t/yacc-clean-cxx.sh
@@ -70,7 +70,7 @@ cat > sub1/parsefoo.yxx << 'END'
#include <cstdio>
// "std::" qualification required by Sun C++ 5.9.
int yylex (void) { return std::getchar (); }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
%}
%%
x : 'x' { };
diff --git a/t/yacc-clean.sh b/t/yacc-clean.sh
index 9ea13a7..c248e5c 100644
--- a/t/yacc-clean.sh
+++ b/t/yacc-clean.sh
@@ -66,7 +66,7 @@ END
cat > sub1/parse.y << 'END'
%{
int yylex () { return (getchar ()); }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
x : 'x' { };
diff --git a/t/yacc-cxx.sh b/t/yacc-cxx.sh
index 0e163eb..b9dcd45 100644
--- a/t/yacc-cxx.sh
+++ b/t/yacc-cxx.sh
@@ -48,7 +48,7 @@ cat > parse1.yy << 'END'
#include <cstdlib>
// "std::" qualification required by Sun C++ 5.9.
int yylex (void) { return std::getchar (); }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
%}
%%
a : 'a' { exit(0); };
diff --git a/t/yacc-d-basic.sh b/t/yacc-d-basic.sh
index 66c1106..b468d55 100644
--- a/t/yacc-d-basic.sh
+++ b/t/yacc-d-basic.sh
@@ -48,7 +48,7 @@ cat > foo/parse.y << 'END'
%{
#include "parse.h"
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
x : 'x' {};
diff --git a/t/yacc-d-vpath.sh b/t/yacc-d-vpath.sh
index e0fb951..86ae07b 100644
--- a/t/yacc-d-vpath.sh
+++ b/t/yacc-d-vpath.sh
@@ -41,7 +41,7 @@ END
cat > parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%token FOOBAR
%%
@@ -74,7 +74,7 @@ $sleep
cat > ../parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%token FUBAR
%%
@@ -94,7 +94,7 @@ $sleep
cat > ../parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%token MAUDE
%%
diff --git a/t/yacc-deleted-headers.sh b/t/yacc-deleted-headers.sh
index 766caac..5b661d1 100644
--- a/t/yacc-deleted-headers.sh
+++ b/t/yacc-deleted-headers.sh
@@ -56,7 +56,7 @@ cat > parse1.y << 'END'
%{
#include "parse1.h"
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
%}
%token ZARDOZ
%%
@@ -81,7 +81,7 @@ sed 's/"parse1\.h"/"parse3.h"/' main1.c > main3.c
cat > parse4.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
%}
%%
x : 'x' {};
diff --git a/t/yacc-depend.sh b/t/yacc-depend.sh
index 27c704b..dc82a31 100644
--- a/t/yacc-depend.sh
+++ b/t/yacc-depend.sh
@@ -36,7 +36,7 @@ END
cat > foo.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
%}
%token TOKEN
%%
diff --git a/t/yacc-depend2.sh b/t/yacc-depend2.sh
index ce730f4..c2b1b9b 100644
--- a/t/yacc-depend2.sh
+++ b/t/yacc-depend2.sh
@@ -42,7 +42,7 @@ END
cat > foo.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
%}
%token TOKEN
%%
diff --git a/t/yacc-dist-nobuild-subdir.sh b/t/yacc-dist-nobuild-subdir.sh
index c918c39..8b15d2c 100644
--- a/t/yacc-dist-nobuild-subdir.sh
+++ b/t/yacc-dist-nobuild-subdir.sh
@@ -36,7 +36,7 @@ mkdir sub
cat > sub/parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
%}
%%
x : 'x' {};
diff --git a/t/yacc-dist-nobuild.sh b/t/yacc-dist-nobuild.sh
index 5e1a2a7..f4d3fbc 100644
--- a/t/yacc-dist-nobuild.sh
+++ b/t/yacc-dist-nobuild.sh
@@ -37,7 +37,7 @@ END
cat > parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-dry.sh b/t/yacc-dry.sh
index c9c1aa2..43e1422 100644
--- a/t/yacc-dry.sh
+++ b/t/yacc-dry.sh
@@ -38,7 +38,7 @@ END
cat > parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-line.sh b/t/yacc-line.sh
index 10e8a8c..ef48d83 100644
--- a/t/yacc-line.sh
+++ b/t/yacc-line.sh
@@ -57,7 +57,7 @@ END
cat > zardoz.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
%}
%%
x : 'x' {};
diff --git a/t/yacc-misc.sh b/t/yacc-misc.sh
index 2371a09..9dc8f9d 100644
--- a/t/yacc-misc.sh
+++ b/t/yacc-misc.sh
@@ -35,7 +35,7 @@ END
cat > parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
@@ -45,7 +45,7 @@ END
cat > bar.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-mix-c-cxx.sh b/t/yacc-mix-c-cxx.sh
index ad9bf95..45dffa0 100644
--- a/t/yacc-mix-c-cxx.sh
+++ b/t/yacc-mix-c-cxx.sh
@@ -53,7 +53,7 @@ END
cat > p.y <<'END'
%{
int yylex (void) { int new = 0; return new; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
%}
%token ZARDOZ
%%
@@ -85,7 +85,7 @@ cat > parse.yy <<'END'
#include <cstdlib>
#include "parse.hh"
int yylex (void) { return 0; }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
%}
%token FOOBAR
%%
@@ -97,7 +97,7 @@ cat > parse2.y++ <<'END'
%{
#include <cstdlib>
int yylex (void) { return 0; }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
%}
%%
x : 'x' {};
diff --git a/t/yacc-nodist.sh b/t/yacc-nodist.sh
index 075e077..3b523e8 100644
--- a/t/yacc-nodist.sh
+++ b/t/yacc-nodist.sh
@@ -59,7 +59,7 @@ parse.y:
:; { : \
&& echo "%{" \
&& echo "int yylex () { return 0; }" \
- && echo "void yyerror (char *s) {}" \
+ && echo "void yyerror (const char *s) {}" \
&& echo "%}" \
&& echo "%%" \
&& echo "maude : 'm' 'a' 'u' 'd' 'e' {}"; \
diff --git a/t/yacc-pr204.sh b/t/yacc-pr204.sh
index 9606f7b..e07f5e5 100644
--- a/t/yacc-pr204.sh
+++ b/t/yacc-pr204.sh
@@ -51,7 +51,7 @@ EOF
cat > parse.y << 'END'
%{
int yylex () {return 0;}
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
maude : 'm' 'a' 'u' 'd' 'e' {};
diff --git a/t/yacc-subdir.sh b/t/yacc-subdir.sh
index 5f38621..879b433 100644
--- a/t/yacc-subdir.sh
+++ b/t/yacc-subdir.sh
@@ -49,7 +49,7 @@ mkdir foo
cat > foo/parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-vpath.sh b/t/yacc-vpath.sh
index f9bb719..5481d96 100644
--- a/t/yacc-vpath.sh
+++ b/t/yacc-vpath.sh
@@ -40,7 +40,7 @@ END
cat > parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
@@ -67,7 +67,7 @@ $sleep
cat > ../parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
@@ -85,7 +85,7 @@ $sleep
cat > ../parse.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
%}
%%
maude : 'm' 'a' 'u' 'd' 'e' {};
diff --git a/t/yflags-cmdline-override.sh b/t/yflags-cmdline-override.sh
index eaee478..63d31fb 100644
--- a/t/yflags-cmdline-override.sh
+++ b/t/yflags-cmdline-override.sh
@@ -43,7 +43,7 @@ END
cat > foo.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
int main () { return 0; }
%}
%%
diff --git a/t/yflags-force-override.sh b/t/yflags-force-override.sh
index 2d5cb55..1346c12 100644
--- a/t/yflags-force-override.sh
+++ b/t/yflags-force-override.sh
@@ -37,7 +37,7 @@ END
cat > foo.y << 'END'
%{
int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
int main () { return 0; }
%}
%%
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [automake-commit] branch master updated: tests: let yacc's yyerror take its argument as a const string,
Paul Eggert <=