Skip to content

-Wuninitialized ignored if type is "const" pointer #37460

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 38112
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @dwblaikie,@rnapier

Extended Description

Compile the following with '-Wuninitialized' and clang fails to diagnose the uninitialized variable.

------------------- test.c -----------------------
extern void foo(const char *p);

int main(){
char *p;
foo(p); // Should produce warning but doesn't
}


If "const" is removed from the parameter to "foo", the warning is emitted as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerfalse-negative

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions