Skip to content

Improve handling of standard types' signedness

Simon McVittie requested to merge wip/smcv/type-signedness-followup into main

Follow-up from !3967 (merged).

  • girparser: Use INTEGER_ALIAS to reduce repetition

    As a special case, keep the historical behaviour of treating gchar as being signed, both on platforms where it is genuinely signed (for example x86 Linux) and where it is unsigned (for example ARM, s390x and PowerPC Linux). Changing gchar to use INTEGER_ALIAS would have a regression risk, so if we want to do that, it should be as a separate change.

    No functional change intended.

  • Provide private G_SIGNEDNESS_OF macro in glib-private.h

  • glib-init: Statically assert that types have appropriate signedness

    Some of these are properties of a Standard C or POSIX platform that are true by definition and checked for completeness (for example intptr_t is defined to be signed, and uintptr_t unsigned), while others are checking that GLib's type detection has been done correctly.

Merge request reports