-
Notifications
You must be signed in to change notification settings - Fork 217
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
JSC: general code cleanup #141
Comments
Imported from trac issue 118. Created by jphickey on 2015-11-06T17:27:04, last modified: 2015-12-09T11:13:56 |
Trac comment by jphickey on 2015-11-09 12:19:50: Commit [changeset:1f9e588] is ready for CCB review. Branch |
Trac comment by jphickey on 2015-11-09 12:20:33: I have reviewed this and recommend ACCEPT. Changes look benign, assuming this is the coding standard(s) that CCB wants to adopt. |
Trac comment by sstrege on 2015-11-16 18:08:35: Approve/accept |
Trac comment by sduran on 2015-11-17 11:05:21: recommend accept |
Trac comment by sstrege on 2015-11-18 13:40:29: 11/10/15 CCB: Need to ensure use of "VOIDFUNCPTR" is safe before accepting this particular code change (/vxworks6/osnetwork.c, line 313) |
Trac comment by sstrege on 2015-11-18 15:21:31: Correction to comment 5 above, this was agreed to at the 11/17/15 CCB |
Trac comment by glimes on 2015-11-20 16:13:33: now part of ic-2015-11-20 |
Trac comment by jphickey on 2015-11-20 17:05:05: To re-iterate the comment above - the If timer_connect truly wants a function with a void return/void argument and OSAL is passing a function that has a void return/int argument, then that is a real bona-fide bug and a cast will only shut off the warning about it. If that is the case (as it appears to be) then we need a fix for the bug and not to cast away the warning about it. |
Trac comment by jphickey on 2015-11-20 17:27:03: Backed this out of the "ic-2015-11-20" merge pending verification of |
Trac comment by jphickey on 2015-11-20 17:28:18: IIRC it was Steve who was going to check the VxWorks doc on this -- If I got that wrong please pass it to whoever was going to double check this. |
Trac comment by sduran on 2015-11-23 12:12:11: From the VxWorks 6.7 man page:
where "routine" is the signal handler, defined on line 149 in ostime.c ic-ccb-review has the handler declared as void, but trac-22 had changed this to static void, due to the MISRA rule that wants all local functions declared as static. The cast to VOIDFUNCPTR appears unecessary. A compiler warning is not generated without it. MISRA, I'm sure does not require a cast like this. Not sure why it was added. I did note however, that the possible_tid type is mismatched from the expected type of timer_connect. I believe this has always been the case in this code. Not sure if we want to do anything about that now. possible_tid is declared as uint32, the the argument timer_id (which gets the value of possible_tid before return) is declared uint32, however the expected argument type for timer_connect is int. |
Trac comment by jphickey on 2015-11-23 23:19:51: In this case, we may actually have a mismatch in the VxWorks coverage stubs. This defines the VOIDFUNCPTR type as: i.e. a function taking no arguments, returning void. However, it looks from this timer_connect API that a VOIDFUNCPTR here is intended to take a single With respect to this function being I also agree that the type for the |
Trac comment by jphickey on 2015-11-24 00:07:25: Replying to [comment:11 sduran]:
With this I have added a new commit [changeset:94f1adc] that reverts the "VOIDFUNCPTR" cast only. This At any rate, someone more familiar with VxWorks would have to look at that, and this ticket will not change the behavior. I have merged this to "ic-ccb-review" and I think this is good to go. |
Trac comment by glimes on 2015-11-24 13:47:52: ''TLDR: casts are what you use on broken code, and this VxWorks API is broken, Notes on This was a bit confusing, as the code as it stands follows the common HOWEVER, static analysis tools and some compilers can be really picky The actual implementation in VxWorks eventually needs a pointer to a The issue arises that VxWorks defines the API in its Picky tools will decide that the type of a function taking Note that strict analysis may also warn about |
Trac comment by glimes on 2015-12-09 10:56:06: Commit [changeset:1f9e588] containing the bulk of the work was included via [changeset:57cd4e8a] into merge [changeset:961b061] which is now the development branch. |
Originally implemented as part of trac #45 and isolated for CCB review purposes.
General code clean up modifications:
The text was updated successfully, but these errors were encountered: