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

Gcc 14 fix try 2 #1735

Closed
wants to merge 4 commits into from
Closed

Gcc 14 fix try 2 #1735

wants to merge 4 commits into from

Conversation

skef
Copy link
Collaborator

@skef skef commented Jan 11, 2024

Test PR to trigger tests

trofi and others added 4 commits December 6, 2023 20:37
…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 *`.
…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 skef closed this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants