-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repeated assignments without using the value (real code edition) #158
Comments
Imported from trac issue 135. Created by glimes on 2015-12-10T14:52:04, last modified: 2016-01-14T11:33:37 |
Trac comment by glimes on 2015-12-31 13:05:51: osnetwork: ostimer: |
Trac comment by glimes on 2015-12-31 13:08:04: ... not sure why I added a "recommend accept" comment to a |
Trac comment by glimes on 2016-01-05 09:56:37: Commit [changeset:ccd776c] |
Trac comment by sduran on 2016-01-08 14:34:39: recommend accept |
Trac comment by sstrege on 2016-01-10 18:28:19: Recommend/accept |
Trac comment by jphickey on 2016-01-11 13:11:40: recommend accept |
Trac comment by glimes on 2016-01-11 13:11:43: Per discussion on CFS CCB telecon, |
Trac comment by glimes on 2016-01-14 11:31:23: Included in the 2016-01-11 CCB merge. |
Trac comment by glimes on 2016-01-14 11:33:37: Development advanced to include the 2016-01-11 merge. |
cppcheck messages:
{{{
src/os/vxworks6/osnetwork.c:73: performance: Variable 'retval' is reassigned a value before the old one has been used.
src/os/vxworks6/ostimer.c:331: style: Variable 'status' is assigned a value that is never used.
}}}
Recommended fix methods, PICK ONE:
(void)
cast on the function call instead of storing the data that is not actually ever going to be looked at. This advertises to maintainers and to the compiler and to static analysis that we are purposefully ignoring the return value of the function.It would be a good idea to check the posix and rtems implementations to see if they have the same construct in this place.
See ticket #157 for the same problem occurring very frequently in unit test code.
The text was updated successfully, but these errors were encountered: