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

Commits on Jun 11, 2024

  1. Fix an error for initialization within YY_INITIAL_VALUE() with C++

    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 committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    be9b052 View commit details
    Browse the repository at this point in the history