Fix ASSIGNWITHINCONDITION checksrc warnings in os400sys.c #2525

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@danielgustafsson
Contributor

danielgustafsson commented Apr 23, 2018

All occurrences of assignment within conditional expression in os400sys.c rewritten into two steps: first assignment and then the check on the success of the assignment. Also adjust related incorrect brace positions to match project indentation style.

This was spurred by seeing if((inp = input_token)), but while in there all warnings were fixed.

There should be no functional change from these changes, but as I don't have an OS/400 system it was done somewhat blind. Thus, this requires actual testing to go anywhere but it seemed a worthwhile exercise to reduce the number of checksrc warnings in the tree.

Fix ASSIGNWITHINCONDITION checksrc warnings
All occurrences of assignment within conditional expression in
os400sys.c rewritten into two steps: first assignment and then
the check on the success of the assignment. Also adjust related
incorrect brace positions to match project indentation style.

This was spurred by seeing "if((inp = input_token))", but while
in there all warnings were fixed.

There should be no functional change from these changes.
@bagder

bagder approved these changes Apr 23, 2018

We don't have any maintainer around on OS/400 these days, so let's just do as best as we can and then once someone comes around and tests it for real we clean up what we missed.

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Apr 23, 2018

Member

any other comments perhaps, @monnerat ?

Member

bagder commented Apr 23, 2018

any other comments perhaps, @monnerat ?

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Apr 25, 2018

Member

Thanks!

Member

bagder commented Apr 25, 2018

Thanks!

@bagder bagder closed this in d25f0a4 Apr 25, 2018

@monnerat

This comment has been minimized.

Show comment Hide comment
@monnerat

monnerat Apr 26, 2018

Collaborator

Nothing special to say about it: most of the updated code is dated 2007 and checksrc has never been applied to it before. The only thing we can hope is it does not break the IBM C compiler since it it is not tested, although not adding any feature.
I also have some changes to apply, in particular to implement the mime interface to OS400. I have not issued any pull request for it yet, expecting some OS400 user willing to test it to manifest on the mailing list.
For the current commit, I cross finger although I'm quite confident.

Collaborator

monnerat commented Apr 26, 2018

Nothing special to say about it: most of the updated code is dated 2007 and checksrc has never been applied to it before. The only thing we can hope is it does not break the IBM C compiler since it it is not tested, although not adding any feature.
I also have some changes to apply, in particular to implement the mime interface to OS400. I have not issued any pull request for it yet, expecting some OS400 user willing to test it to manifest on the mailing list.
For the current commit, I cross finger although I'm quite confident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment