-
Notifications
You must be signed in to change notification settings - Fork 167
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 build failures discovered by an upcoming gcc-14
release
#1730
Merged
Conversation
This file contains 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
…cc-14) Upcoming `gcc-14` enabled a few warnings into errors, like `-Wint-conversion`. This caused `afdko` build to fail as: /build/afdko/c/shared/source/uforead/uforead.c:1243:20: error: passing argument 2 of ‘message’ makes pointer from integer without a cast [-Wint-conversion] 1243 | message(h, ufoErrParse, "Encountered glyph reference %s in alternate layer's contents.plist with an empty file path. ", glyphName); | ^~~~~~~~~~~ | | | int It looks like `ufoErrParse` is an unexpected parameter here. While at it fixed build failure related to int/pointer error: /build/afdko/c/shared/source/uforead/uforead.c:2007:16: error: returning ‘void *’ from a function with return type ‘long int’ makes integer from pointer without a cast [-Wint-conversion] 2007 | return NULL; | ^~~~
…e (gcc-14) Upcoming `gcc-14` enabled a few warnings into errors, like `-Wincompatible-pointer-types`. This caused `afdko` build to fail as: /build/afdko/c/shared/source/tx_shared/tx_shared.c: In function ‘stmInit’: /build/afdko/c/shared/source/tx_shared/tx_shared.c:526:20: error: assignment to ‘size_t (*)(ctlStreamCallbacks *, void *, char **)’ {aka ‘long unsigned int (*)(struct ctlStreamCallbacks_ *, void *, char **)’} from incompatible pointer type ‘size_t (*)(ctlStreamCallbacks *, Stream *, char **)’ {aka ‘long unsigned int (*)(struct ctlStreamCallbacks_ *, Stream *, char **)’} [-Wincompatible-pointer-types] 526 | h->cb.stm.read = stm_read; | ^ The change fixes opaque parameter to pass as `void *`.
skef
previously approved these changes
Jan 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…rence (gcc-14) Upcoming `gcc-14` enabled a few warnings into errors, like `-Wincompatible-pointer-types`. This caused `afdko` build to fail as: /build/afdko/c/shared/source/t1write/t1write.c: In function ‘saveCstr’: /build/afdko/c/shared/source/t1write/t1write.c:348:28: error: passing argument 3 of ‘writeTmp’ from incompatible pointer type [-Wincompatible-pointer-types] 348 | if (writeTmp(h, 1, &info->iFD)) | ^~~~~~~~~~ | | | uint16_t * {aka short unsigned int *} The code attempts to use only one byte of 16-bit value. The code very likely is broken on a big-endian system. The change explicitly truncates 16-bit value down to 8 bit value to retain existing behaviour on both BE and LE systems.
skef
approved these changes
Jan 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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.
Description
Upcoming
gcc-14
enabled a few warnings into errors. This exposed build failures related to pointer type confusion.