https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69723
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
Summary|Inconsistent report of |pre-post-increment/decremen
|unused and uninitialized |t and reading the same
|variables |variable that is assigned
| |should not be considered
| |uses for
| |Wunused-but-set-variable
Severity|trivial |normal
--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Peter VARGA from comment #5)
> I do not understand what you mean with "Replace unused++ with unused =
> unused + 1".
>
> How ever. I checked my example code in Compiler Explorer with clang and
> clang generates a warning as it should be.
Only for the -Wuninitialized (which GCC warns with -O1). Clang doesn't even
catch
void foo() {
int unused;
unused=0;
}
*** This bug has been marked as a duplicate of bug 44677 ***