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

Fix ASSIGNWITHINCONDITION checksrc warnings in os400sys.c #2525

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@danielgustafsson
Member

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.

Member

bagder commented Apr 23, 2018

any other comments perhaps, @monnerat ?

@bagder

This comment has been minimized.

Member

bagder commented Apr 25, 2018

Thanks!

@bagder bagder closed this in d25f0a4 Apr 25, 2018

@monnerat

This comment has been minimized.

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 25, 2018

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