Remove the -Wno-stringop-overflow warning suppression#11355
Closed
freak82 wants to merge 2 commits into
Closed
Conversation
The problem was that GCC complained for possibly incorrect usage of strncat due to the last argument being equal to the source string length. The last argument of strncat is supposed to be the remaining free space in the destination buffer. Replaced the usage of strncat with the ATS function ink_strlcat.
…spec* The code was wrongly copying from timespec** to timespec*. There was a warning emitted from GCC about this.
Contributor
Author
|
I apologize for including the fix about the |
brbzull0
requested changes
May 15, 2024
| #ifdef HAVE_SO_TXTIME | ||
| if (send_at_hint) { | ||
| memcpy(&p->p.send_at, &send_at_hint, sizeof(struct timespec)); | ||
| memcpy(&p->p.send_at, send_at_hint, sizeof(struct timespec)); |
Contributor
There was a problem hiding this comment.
Ohh!! this a very good catch.
Must have done some refactor before pushing this and let this slide!!
Please split this into a different PR just in case.
@freak82 thanks for finding and making a PR to fix this!!
Contributor
Author
There was a problem hiding this comment.
Ok. Will close this PR and make new ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
-Wstringop-overflowwarning was caused by single usage ofstrncatfunction.The problem was that GCC complained for possibly incorrect usage of
strncatdue to the last argument being equal to the source string length. The last argument of strncat is supposed to be the remaining free space in the destination buffer.Replaced the usage of
strncatwith the ATS functionink_strlcat.More info about this can be found in this ATS issue