Files
John Ericson 9287f5433e gccNGPackages.libgomp: size the device UID buffer for a negative int
`gomp_get_uid_for_device` allows ten digits for the `%d`, but `device_num`
is a plain `int`, whose widest rendering is `-2147483648` -- eleven. With
the eight-character `OMP_DEV_` prefix that is twenty bytes plus the NUL into
a nineteen-byte buffer. GCC 16 started noticing, and `libgomp` builds with
`-Werror`:

    target.c:5956:31: error: 'snprintf' output may be truncated before the
    last format character [-Werror=format-truncation=]

A real off-by-one rather than a false positive, so fix the size instead of
silencing the warning. My first guess was that fortify was to blame, since
the diagnostic named `__builtin___snprintf_chk`; it is not -- turning
hardening off only changes the name in the message.

Co-authored-by: Ben Siraphob <bensiraphob@gmail.com>
Assisted-by: Claude Code (Claude Opus 5)
2026-09-03 13:19:36 -04:00
..