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 build failures discovered by an upcoming gcc-14 release #1730

Merged
merged 4 commits into from
Jan 11, 2024
Merged

Fix build failures discovered by an upcoming gcc-14 release #1730

merged 4 commits into from
Jan 11, 2024

Commits on Dec 6, 2023

  1. c/shared/source/uforead/uforead.c: fix message() format argument (g…

    …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;
              |                ^~~~
    trofi committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    51394a1 View commit details
    Browse the repository at this point in the history
  2. /build/afdko/c/shared/source/tx_shared/tx_shared.c: fix parameter typ…

    …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 *`.
    trofi committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    057e354 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. c/shared/source/t1write/t1write.c: fix u8/u16 type mismatch on derefe…

    …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.
    trofi authored and skef committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    cdef7b3 View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2024

  1. Skip copyright line in test

    skef committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    79dbb76 View commit details
    Browse the repository at this point in the history