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

New warning on macOS #2139

Closed
certik opened this issue Jul 10, 2023 · 2 comments · Fixed by #2145
Closed

New warning on macOS #2139

certik opened this issue Jul 10, 2023 · 2 comments · Fixed by #2145

Comments

@certik
Copy link
Contributor

certik commented Jul 10, 2023

/Users/ondrej/repos/lpython/src/libasr/codegen/llvm_utils.cpp:1487:21: warning: variable 'pred' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
                    default: {
                    ^~~~~~~
/Users/ondrej/repos/lpython/src/libasr/codegen/llvm_utils.cpp:1491:43: note: uninitialized use occurs here
                return builder->CreateCmp(pred, left, right);
                                          ^~~~
/Users/ondrej/repos/lpython/src/libasr/codegen/llvm_utils.cpp:1465:9: note: variable 'pred' is declared here
        llvm::CmpInst::Predicate pred;
        ^

I thought we test for this at the CI. Maybe we only do it for LFortran.

@Shaikh-Ubaid
Copy link
Collaborator

Shaikh-Ubaid commented Jul 10, 2023

I thought we test for this at the CI. Maybe we only do it for LFortran.

Yes, we have to add -Werror at the CI. We previously discussed it here #2062 (review). I have a minor concern. When building lpython there is warning about unused variable yynerrs in parser.tab.cc. This file parser.tab.cc is a generated file, thus we are unable to use the variable or add maybe unused. We do not experience this in lfortran since it uses %glr-parser, where as (it seems) lpython uses LR(1) parser.

The warning of unused variable yynerrs in parser.tab.cc seems to be a bug in bison. This bug seems to be fixed in the latest bison, but they did not make a release of it post fixing. I have requested for a release here akimd/bison#103.

@certik
Copy link
Contributor Author

certik commented Jul 10, 2023

There might be a way to turn off -Werror for the Bison file. Alternatively we can "post process" the file to remove "yynerrs" with a Python script.

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 a pull request may close this issue.

2 participants