Skip to content

Why isn‘t any warning for elements uninitialized in a Structure using Wuninitialized  #104744

Open
@Zhenhang1213

Description

@Zhenhang1213

Why isn‘t any warning for elements uninitialized in a Structure using Wuninitialized ?And uninitialized variables have warnings: https://godbolt.org/z/qPaYTrEnh

#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>

struct ab {
    int c;
    int d;
    int f;
};

int main() {
    int a;
    printf("%d", a);
    struct ab bc;
    printf("%d", bc.d);
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:analysisclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions