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 #435, fix string manipulations to avoid warnings #441

Merged
merged 2 commits into from
May 11, 2020

Conversation

jphickey
Copy link
Contributor

Describe the contribution
Resize buffers and add explicit termination to string copies.
Avoids warnings on GCC9 with strict settings and optimization enabled.

Fixes #435

Testing performed
Build with default config and gcc 9.3.0 and confirm warnings are gone

Expected behavior changes
Warnings fixed.

System(s) tested on
Ubuntu 20.04 LTS

Additional context
Currently a draft because it uses PR #427 as a baseline. Will mark as non-draft once prerequisite is merged.

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey Vantage Systems, Inc.

Resize buffers and tweak string copies to avoid truncation warnings
in GCC 9.  Note the code was generally OK (handled truncation) but
the new compiler still generates warnings even with correct usage
of certain functions.

In the UT_os_printf macro, be sure to "use" the return value
of the snprintf() call, which avoids warnings about truncation.
@jphickey jphickey added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label May 5, 2020
@jphickey jphickey marked this pull request as ready for review May 5, 2020 18:32
@jphickey
Copy link
Contributor Author

jphickey commented May 5, 2020

This is now rebased to "master" and its good to go.

@astrogeco
Copy link
Contributor

CCB 20200506 - Will revisit to touch up, concept approved

@astrogeco astrogeco added CCB-20200506 and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels May 6, 2020
@astrogeco astrogeco changed the base branch from master to integration-candidate May 8, 2020 19:16
@astrogeco astrogeco added CCB:Approved Indicates code review and approval by community CCB IC-20200429 labels May 8, 2020
@astrogeco
Copy link
Contributor

@jphickey I remember there was an extra fix you wanted to add to this but I don't recall the specifics...

@astrogeco astrogeco merged commit c1555b8 into nasa:integration-candidate May 11, 2020
@jphickey jphickey deleted the fix-435-string-ops branch May 14, 2020 13:38
@skliper skliper added this to the 5.1.0 milestone Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhandled output truncation errors when building on CentOS 8.1
3 participants