You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These examples are undefined in C++, but valid in C; we should probably just disable this warning in C. (Without doing a significantly more sophisticated analysis, it's going to be hard to get it right.)
Extended Description
Consider the following example:
void init(int*);
void foo(void) {
int i = ({
init(&i);
i;
});
}
struct widget {
int x, y;
};
void init2(struct widget*);
void bar(void) {
struct widget my_widget = ({
init2(&my_widget);
my_widget;
});
}
warning: variable 'my_widget' is uninitialized when used within its own initialization [-Wuninitialized]
It seems like it's ok to do so for non-aggregate types, but aggregates issue the warning. I think it should not be a warning here?
The text was updated successfully, but these errors were encountered: