Skip to content
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

Conversation

danielgustafsson
Copy link
Member

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.

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.
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

bagder commented Apr 23, 2018

any other comments perhaps, @monnerat ?

@bagder
Copy link
Member

bagder commented Apr 25, 2018

Thanks!

@bagder bagder closed this in d25f0a4 Apr 25, 2018
@monnerat
Copy link
Contributor

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.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants