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 an error for initialization within YY_INITIAL_VALUE() with C++ #443

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

ydah
Copy link
Collaborator

@ydah ydah commented Jun 11, 2024

Fix: #442

Before:

❯ exe/lrama -d sample/calc.y -o calc.c && cc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && gcc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && c++ -Wall calc.c -o calc
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
calc.c:1199:40: error: default initialization of an object of const type 'const YYSTYPE' without a user-provided default constructor
YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)

After:

❯ exe/lrama -d sample/calc.y -o calc.c && cc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && gcc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && c++ -Wall calc.c -o calc
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]

Fix: ruby#442

Before:
```
❯ exe/lrama -d sample/calc.y -o calc.c && cc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && gcc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && c++ -Wall calc.c -o calc
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
calc.c:1199:40: error: default initialization of an object of const type 'const YYSTYPE' without a user-provided default constructor
YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)
```

After:
```
❯ exe/lrama -d sample/calc.y -o calc.c && cc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && gcc -Wall calc.c -o calc

❯ exe/lrama -d sample/calc.y -o calc.c && c++ -Wall calc.c -o calc
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
```
@ydah ydah merged commit 85efe0e into ruby:master Jun 17, 2024
16 checks passed
@ydah ydah deleted the fix-error-in-cpp branch June 17, 2024 15:34
yui-knk added a commit to yui-knk/lrama that referenced this pull request Jun 18, 2024
This is a follow up of ruby#443
yui-knk added a commit to yui-knk/lrama that referenced this pull request Jun 18, 2024
This is a follow up of ruby#443
yui-knk added a commit to yui-knk/lrama that referenced this pull request Jun 18, 2024
This is a follow up of ruby#443
@yui-knk yui-knk mentioned this pull request Jun 18, 2024
ydah pushed a commit to ydah/lrama that referenced this pull request Aug 9, 2024
This is a follow up of ruby#443
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.

Error in initialization within YY_INITIAL_VALUE() with C++
1 participant