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

Fix unknown type error when using YYSTYPE or YYLTYPE #164

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

ydah
Copy link
Collaborator

@ydah ydah commented Oct 29, 2023

❯ exe/lrama -d sample/parse.y -o calc.c && gcc -Wall calc.c -o calc
sample/parse.y:8:31: error: unknown type name 'YYSTYPE'
static enum yytokentype yylex(YYSTYPE *lval, YYLTYPE *yylloc);
                              ^
sample/parse.y:8:46: error: unknown type name 'YYLTYPE'
static enum yytokentype yylex(YYSTYPE *lval, YYLTYPE *yylloc);
                                             ^
sample/parse.y:9:21: error: unknown type name 'YYLTYPE'
static void yyerror(YYLTYPE *yylloc, const char *msg);
                    ^
calc.c:1201:9: warning: variable 'yynerrs' set but not used [-Wunused-but-set-variable]
    int yynerrs = 0;
        ^
1 warning and 3 errors generated.

```
❯ exe/lrama -d sample/parse.y -o calc.c && gcc -Wall calc.c -o calc
sample/parse.y:8:31: error: unknown type name 'YYSTYPE'
static enum yytokentype yylex(YYSTYPE *lval, YYLTYPE *yylloc);
                              ^
sample/parse.y:8:46: error: unknown type name 'YYLTYPE'
static enum yytokentype yylex(YYSTYPE *lval, YYLTYPE *yylloc);
                                             ^
sample/parse.y:9:21: error: unknown type name 'YYLTYPE'
static void yyerror(YYLTYPE *yylloc, const char *msg);
                    ^
calc.c:1201:9: warning: variable 'yynerrs' set but not used [-Wunused-but-set-variable]
    int yynerrs = 0;
        ^
1 warning and 3 errors generated.
```
@yui-knk yui-knk merged commit db66188 into ruby:master Oct 29, 2023
14 checks passed
@yui-knk
Copy link
Collaborator

yui-knk commented Oct 29, 2023

Good catch!

@ydah ydah deleted the fix-unknown-type-name branch October 29, 2023 12:49
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

Successfully merging this pull request may close these issues.

2 participants