Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated code fails with -ansi #37

Closed
t-bltg opened this issue May 9, 2020 · 1 comment
Closed

Generated code fails with -ansi #37

t-bltg opened this issue May 9, 2020 · 1 comment

Comments

@t-bltg
Copy link

t-bltg commented May 9, 2020

My swig build fails with the latest bison version 3.6. The generated code fails to compile with -ansi compiler flag.

The issue is with the c++ style comment here https://github.com/akimd/bison/blob/master/src/parse-gram.c#L2708 (also in some other locations: data/skeletons/yacc.c, ...)

A fix would be:

--- src/parse-gram.c  2020-05-09 11:07:53.483627254 +0000
+++ src/parse-gram.c  2020-05-09 11:08:05.619952863 +0000
@@ -2705,7 +2705,7 @@
 yyerrlab1:
   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
-  // Pop stack until we find a state that shifts the error token.
+  /* Pop stack until we find a state that shifts the error token. */
   for (;;)
     {
       yyn = yypact[yystate];

--- data/skeletons/yacc.c  2020-05-09 11:20:47.180538119 +0000
+++ data/skeletons/yacc.c  2020-05-09 11:21:03.464980276 +0000
@@ -1979,7 +1979,7 @@
 yyerrlab1:
   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
-  // Pop stack until we find a state that shifts the error token.
+  /* Pop stack until we find a state that shifts the error token. */
   for (;;)
     {
       yyn = yypact[yystate];

Thanks.

@t-bltg t-bltg changed the title Genreated code fails with -ansi Generated code fails with -ansi May 9, 2020
@akimd
Copy link
Owner

akimd commented May 9, 2020

Bummer. Thanks for this report. I don't understand why this was not caught by our CI.

akimd added a commit that referenced this issue May 9, 2020
Reported by neok-m4700.
#37

* data/skeletons/yacc.c: Don't use // comments.
@t-bltg t-bltg closed this as completed May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants