https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95057
Bug ID: 95057
Summary: missing -Wunused-but-set-variable warning on multiple
assignments, not all of them used
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: vincent-gcc at vinc17 dot net
Target Milestone: ---
With -Wunused-but-set-variable, GCC does not warn in the following cases:
int f (int i)
{
int j;
j = i + 1; /* unused */
j = i + 2;
return j;
}
int g (int i)
{
int j, k;
j = i + 1;
k = j + 1;
j = i + 2; /* unused */
return k;
}
Note: it is possible that PR44677 may be regarded as a particular case of this
bug.