From bd402153afb2a5279414d156e34d23010af4e460 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 5 Jun 2026 11:56:14 -0700 Subject: [PATCH] mesa/main: cast GLhandleARB to unsigned int in api trace The generated api_trace.c passes GLhandleARB arguments to _mesa_debug() with a "%u" conversion. On macOS GLhandleARB is unsigned long, so this triggers -Werror=format and breaks the build: api_trace.c:5307:52: error: format specifies type 'unsigned int' but the argument has type 'GLhandleARB' (aka 'unsigned long') Cast the value to unsigned int to match the "%u" conversion on all platforms. GL handles fit in 32 bits, and on Linux GLhandleARB is already unsigned int, so behavior is unchanged. Fixes: 9f7f5a27a7ed ("mesa/main: Auto-generate MESA_VERBOSE=api trace dispatch") Assisted-by: Claude Code (Claude Opus 4.8) Signed-off-by: Vinson Lee Reviewed-by: Christian Gmeiner Part-of: --- src/mesa/glapi/glapi/gen/api_trace_c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/glapi/glapi/gen/api_trace_c.py b/src/mesa/glapi/glapi/gen/api_trace_c.py index da815bd620f..f69ea964483 100644 --- a/src/mesa/glapi/glapi/gen/api_trace_c.py +++ b/src/mesa/glapi/glapi/gen/api_trace_c.py @@ -50,7 +50,7 @@ TYPE_FORMAT = { 'GLhalfNV': ('0x%x', '{p}'), 'GLvdpauSurfaceNV': ('%" PRIdPTR "', '(intptr_t){p}'), 'GLsync': ('%p', '(void *){p}'), - 'GLhandleARB': ('%u', '{p}'), + 'GLhandleARB': ('%u', '(unsigned int){p}'), 'GLDEBUGPROC': ('%p', '(void *){p}'), 'GLDEBUGPROCARB': ('%p', '(void *){p}'), 'GLDEBUGPROCAMD': ('%p', '(void *){p}'),