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
This a matter of order-of-operations - nothing can currently fail after the condition var is created, but that's just the current form.
Although unreachable right now if something gets added in the future (e.g. setting an attribute or something after the cond was created) then this will become relevant/possible to reach this again. So I wouldn't necessarily recommend removing this - as it is a bit of future-proofing - a change elsewhere in the function can easily make it reachable again.
Rather than removing I would suggest adding something else - such as a "test" call to pthread_cond_signal() - and check the status (should always be successful on a cond var that was just created, and a no-op because nothing is pending). So this should always succeed, but it will provide a theoretical path where the cleanup has to do both - so it won't be flagged as unreachable anymore.
skliper
added a commit
to skliper/osal
that referenced
this issue
Feb 11, 2021
Is your feature request related to a problem? Please describe.
Can't reach:
osal/src/os/posix/src/os-impl-binsem.c
Lines 217 to 220 in 09a2c5e
Describe the solution you'd like
Refactor to eliminate dead code.
Describe alternatives you've considered
None
Additional context
Static analysis warning
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: