You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Useless assignments since FileOpened is initialized to false (or already checked for false):
Describe alternatives you've considered
None, useless assignments in the name of future-proofing is a slippery slope. To some (like me) these useless assignments make me thing the implementer didn't fully understand the implemented logic, was sloppy/careless, or added useless logic "just in case".
I concur these are redundant - not even future-proofing, really - just redundant.
Also a pet peeve of mine:
instead of testing if (FileOpened == true) and if (FileOpened == false) we should be testing if (FileOpened) and if (!FileOpened), respectively.
This is (was?) more of a real risk when using uint8 as a stand-in for bool ... but with the C99 semantics of the real bool type it should be equivalent ... but it's still ugly (IMO).
skliper
changed the title
Useless assignments - static analysis warning
Useless assignments/redundant checks - static analysis warning
Mar 3, 2021
skliper
added a commit
to skliper/cFE
that referenced
this issue
Mar 17, 2021
Is your feature request related to a problem? Please describe.
Useless assignments since FileOpened is initialized to false (or already checked for false):
cFE/fsw/cfe-core/src/es/cfe_es_apps.c
Line 109 in c708d64
cFE/fsw/cfe-core/src/es/cfe_es_apps.c
Line 134 in c708d64
Initialized to zero, then set to zero:
cFE/fsw/cfe-core/src/time/cfe_time_tone.c
Line 1464 in 672b2dc
Already memset to 0:
cFE/fsw/cfe-core/src/evs/cfe_evs_task.c
Line 91 in 672b2dc
Already checked for NumBlockSizes . CFE_PLATFORM_ES_POOL_MAX_BUCKETS
cFE/fsw/cfe-core/src/es/cfe_es_mempool.c
Line 203 in 672b2dc
Already CFE_SUCCESS:
cFE/fsw/cfe-core/src/es/cfe_es_generic_pool.c
Line 458 in 672b2dc
Describe the solution you'd like
Remove.
Describe alternatives you've considered
None, useless assignments in the name of future-proofing is a slippery slope. To some (like me) these useless assignments make me thing the implementer didn't fully understand the implemented logic, was sloppy/careless, or added useless logic "just in case".
Additional context
wait for #972
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: