From 648141d8ffcbd9617f26bf63c6254c19c84a36f8 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 30 Sep 2025 16:08:04 +0100 Subject: [PATCH] tests: Use integer widths rather than maximum values for strfuncs check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The maximum values can expand to something containing `__extension__` on some platforms (like msys2-clang64), and the preprocessor can’t understand that. So, use the type widths rather than their maximum values instead. This is equivalent, but definitely won’t expand to `__extension__`. Should hopefully fix the following compiler error on msys2-clang64: ``` ../glib/tests/strfuncs.c:667:5: error: function-like macro '__extension__' is not defined 667 | #if G_MAXSIZE > G_MAXUINT | ^ glib/glibconfig.h:89:19: note: expanded from macro 'G_MAXSIZE' 89 | #define G_MAXSIZE G_MAXUINT64 | ^ ../glib/gtypes.h:107:21: note: expanded from macro 'G_MAXUINT64' 107 | #define G_MAXUINT64 G_GUINT64_CONSTANT(0xffffffffffffffff) | ^ glib/glibconfig.h:70:34: note: expanded from macro 'G_GUINT64_CONSTANT' 70 | #define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL)) | ^ ../glib/gmacros.h:62:26: note: expanded from macro 'G_GNUC_EXTENSION' 62 | #define G_GNUC_EXTENSION __extension__ | ^ 1 error generated. ``` (as seen in https://gitlab.gnome.org/GNOME/glib/-/jobs/5608465) Co-authored by: Luca Bacci Signed-off-by: Philip Withnall --- glib/tests/strfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c index 278fbaed7..b5c985e87 100644 --- a/glib/tests/strfuncs.c +++ b/glib/tests/strfuncs.c @@ -664,7 +664,7 @@ test_strconcat (void) static void test_strjoinv_overflow (void) { -#if G_MAXSIZE > G_MAXUINT +#if GLIB_SIZEOF_SIZE_T > (UINT_WIDTH / 8) g_test_skip ("Overflow joining strings requires G_MAXSIZE <= G_MAXUINT."); #else if (!g_test_undefined ())