mesa/main: cast GLhandleARB to unsigned int in api trace
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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: 9f7f5a27a7 ("mesa/main: Auto-generate MESA_VERBOSE=api trace dispatch")
Assisted-by: Claude Code (Claude Opus 4.8)
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42059>
This commit is contained in:
Vinson Lee 2026-06-05 11:56:14 -07:00
parent 31db17f653
commit bd402153af

View file

@ -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}'),