• Philip Chimento's avatar
    build: Test for %Id as alternate integer output · be2cf989
    Philip Chimento authored
    %Id is a glibc extension. The "I" character is used elsewhere in other
    extensions too. For example, %I is a Microsoft extension for printing
    size_t. Although undocumented on Darwin, that platform's libc emulates
    the Microsoft extension.
    
    If %I is interpreted as size_t, then the code is likely to crash on
    platforms where int and size_t are different widths, such as 64-bit OSX.
    
    This adds a configure-time check for %Id. When it's not supported, then
    the provided sample program will error out when compiled with -Werror. If
    not supported then we simply print %d since I don't believe the
    alternative representation flag has any other equivalent on other
    platforms.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773297
    be2cf989
gjs-util.cpp 3.33 KB