]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: fix bison input file
authorAkim Demaille <akim@lrde.epita.fr>
Sat, 14 Jul 2012 07:07:52 +0000 (09:07 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 14 Jul 2012 10:10:22 +0000 (12:10 +0200)
Do not provide implementations in the %{...%} section, especially if the
header is included elsewhere, since then the linker will complain about
multiple definitions.

Reported by Stefano Lattarini,
<http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00126.html>.

* t/yacc-bison-skeleton.sh (zardoz.y): Define yylex and yyerror in the
epilogue.

t/yacc-bison-skeleton.sh

index 5bf909239f15b965c2537328c30a7a8e44fa244c..9e9f514f0652164ee1acf04709653bf6bd064197 100755 (executable)
@@ -35,11 +35,14 @@ END
 # Parser.
 cat > zardoz.y << 'END'
 %{
-int yylex () { return 0; }
-void yyerror (const char *s) { return; }
+int yylex ();
+void yyerror (const char *s);
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+%%
+int yylex () { return 0; }
+void yyerror (const char *s) { return; }
 END
 
 cat > foo.c << 'END'