[Bug other/94629] 10 issues located by the PVS-studio static analyzer

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Fri Apr 17 10:09:07 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94629

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Jakub Jelinek from comment #5)
> We should for GCC11 discuss if we want to implement some of these checks,
> either in -fanalyzer, or as normal GCC warnings.
> E.g. the
>  foo = something;
>  // code that can't affect foo
>  foo = somethingelse;
> is perhaps something that should be warned as early as possible after
> getting into GIMPLE, before inlining because it is quite common that inlines
> overwrite something, and in the FEs it is likely too early.

A quick look at recent cppcheck output over the gcc trunk source code
suggests that there are 162 cases of redundant assignment like this.

Some of them might well be false positives.


More information about the Gcc-bugs mailing list