Skip to content

Using address of global non-weak is tautologic #10541

@jsonn

Description

@jsonn
Bugzilla Link 10169
Version trunk
OS Linux
CC @tkremenek,@seanm

Extended Description

int foo;

int main(void)
{
  return &foo ? 1 : 0;
}

gives a warning with GCC 4.5.

Possible exceptions are: section, weak or weakref attribute set. This warning triggered at least one real bug in the NetBSD code base, so it is useful to have.

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 analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions