Cppcheck emits no redundantInitialization diagnostic. The plain form float value = input; does produce redundantInitialization, isolating
explicit conversion handling.
Expected behavior
Cppcheck should report that the initialized value is overwritten before it is read.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cppcheck 2.21.0 misses an initialization whose explicit floating conversion is overwritten before the initialized value is read.
Affected tool and checker
Cppcheck 2.21.0,redundantInitialization.Minimal reproducer
Reproduction command
Current behavior
Cppcheck emits no
redundantInitializationdiagnostic. The plain formfloat value = input;does produceredundantInitialization, isolatingexplicit conversion handling.
Expected behavior
Cppcheck should report that the initialized value is overwritten before it is read.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/15037