Skip to content

-Wuninitialized fails to emit a warning for uninitialized fixed-size local arrays #165239

@ams-x9v2b7kq

Description

@ams-x9v2b7kq

c is uninitialized and used in the main function.
Options: -Wall -Wextra -Wuninitialized -Wconditional-uninitialized -O2
Link: https://godbolt.org/z/1aMWdEfjr
Code:

int b[24] = {0};
int main() {
  int c[24];
  for (int d = 0; d < 24; ++d)
    b[d] = c[d];
  __builtin_printf("%d\n", b[0]);
  return 0;
}

This might be related to #66448

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerfalse-negativeWarning doesn't fire when it should

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions