amazon-ion / ion-c

A C implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
166 stars 43 forks source link

Update MacOS build to use GCC 14 #353

Closed nirosys closed 2 weeks ago

nirosys commented 2 weeks ago

Issue #, if available: actions/runner-images#10213

Description of changes: Recently GCC 11 was removed from all MacOS images. This PR updates our build & test to use GCC 14.

Might be worth seeing if we can auto-populate the alias so we don't have to keep this in sync.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

nirosys commented 2 weeks ago

👎

/Users/runner/work/ion-c/ion-c/ionc/ion_allocation.c:95:42: error: pointer type mismatch in conditional expression [-Wincompatible-pointer-types]
   95 |     memcpy(dst->value, (is_empty) ? "\0" : src->value, (is_empty) ? 1 : src->length);
nirosys commented 2 weeks ago

More reason to double down on getting rid of all of the warnings that ion-c produces, and enforcing a zero warning policy. Clang 15 defaults to treating this as a warning. GCC 14 raises it as an error.

nirosys commented 2 weeks ago

Also:

/Users/glitch/Code/ion-c/ionc/ion_internal.h:112:71: error: passing argument 2 of 'ion_stream_read_byte' from incompatible pointer type [-Wincompatible-pointer-types]
  112 |                                   IONCHECK(ion_stream_read_byte((xh), &(xb)));  \
      |                                                                       ^~~~~
      |                                                                       |
      |                                                                       uint64_t * {aka long long unsigned int *}