• Simon McVittie's avatar
    glib-init: statically assert that int is exactly 32 bits long · be4fd3d0
    Simon McVittie authored
    The GVariant documentation says you can assume that types of no more
    than 32 bits may be assumed to be promoted to int by the usual
    promotions. If we're going to document that, we should statically
    assert that it's true, i.e. sizeof (int) >= sizeof (int32_t).
    
    All reasonable modern platforms are either ILP32 (32-bit platforms),
    LP64 (64-bit Linux, *BSD etc.), or LLP64 (64-bit Windows): there have
    been ILP64 platforms in the past, but ILP64 has the compelling
    disadvantage that {signed char, short, int} can't possibly provide
    all of {int8_t, int16_t, int32_t} unless int is 32 bits long.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=730932Signed-off-by: Simon McVittie's avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
    Reviewed-by: Colin Walters
    be4fd3d0
glib-init.c 8.79 KB