[Bug c/105323] assignment that is unused afterwards is not reported

2022-05-14 Thread floridsleeves at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105323

--- Comment #2 from Li Zhong  ---
Any further comment on this?
To do data flow analysis in local variable relatively costs less time and can
definitely help developers find more bugs like forgetting return value, etc.

[Bug c/105323] assignment that is unused afterwards is not reported

2022-04-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105323

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
Summary|Unused assignment does not  |assignment that is unused
   |get reported|afterwards is not reported
   Keywords||diagnostic

--- Comment #1 from Andrew Pinski  ---
Currently set but unused only tracks if the variable is ever unused and not if
it is unused afterwards.

This requires data flow really to do such a warning.