← 输入框|github.com|刷新
Skip to content

New warning on macOS #2139

Closed
Closed

Description

@certik
/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.

Activity

  1. ubaidsk commented on Jul 10, 2023

    @ubaidsk
    Collaborator

    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.

  2. certik commented on Jul 10, 2023

    @certik
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions