Update VA_COPY macro to use va_copy function#3
Open
programmer-1101 wants to merge 4 commits intooffscale:masterfrom
Open
Update VA_COPY macro to use va_copy function#3programmer-1101 wants to merge 4 commits intooffscale:masterfrom
programmer-1101 wants to merge 4 commits intooffscale:masterfrom
Conversation
va_list isn't guarenteed to be a simple assignable type. In the case it's not #define VA_COPY(dest, src) (dest) = (src) produces undefined behaviour
SamuelMarks
reviewed
Apr 26, 2026
| const char *start; | ||
|
|
||
| /* Fix assignment of targetLength. C89 requires variables to be defined at beginning of a scope */ | ||
| targetLength = strlen(target); |
Member
There was a problem hiding this comment.
It was defined at the top of scope? - And the way I had it enabled it to be const…
Author
There was a problem hiding this comment.
You are right change was unnecessory. sorry about that.
SamuelMarks
reviewed
Apr 26, 2026
| char *strcasestr(const char *h, const char *n) { | ||
| const size_t l = strlen(n); | ||
| size_t l; | ||
| l = strlen(n); |
Member
There was a problem hiding this comment.
It was defined at the top of scope? - And the way I had it enabled it to be const…
SamuelMarks
reviewed
Apr 26, 2026
| #else | ||
| #define NUM_FORMAT "%lld" | ||
| /* Fix:- Change from C99 long long to long */ | ||
| #define NUM_FORMAT "%ld" |
Member
There was a problem hiding this comment.
You might want to guard this behind an if c89 do lld else do ld
SamuelMarks
reviewed
Apr 26, 2026
| @@ -1,5 +1,5 @@ | |||
| freebsd_instance: | |||
| image_family: freebsd-13-0 | |||
| image_family: freebsd-14 | |||
…ability Choose between %lld and %ld based on compiler support for long long.
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.
Edit c89stringutils_string_extras.c for C89 compliance.
Key Changes:
This resolves build failures on architectures (like x86_64 and PowerPC)
where va_list is an array type and cannot be assigned using '='.