nir: Disable gcc warning -Wstringop-overflow for nir_intrinsic_set_* for latter commit

gcc has a a false positive here, silenced with the pragmas, use separate commit
for easily revert latter once gcc fixed it.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38313>
This commit is contained in:
Yonggang Luo 2025-11-13 03:55:29 +08:00 committed by Marge Bot
parent e231aec0c9
commit 34e7fa2fe6

View file

@ -55,7 +55,11 @@ nir_intrinsic_set_${name}(nir_intrinsic_instr *instr, ${data_type} val)
assert(info->index_map[${enum}] > 0);
% if "struct" in data_type:
STATIC_ASSERT(sizeof(instr->const_index[0]) == sizeof(val));
/* NOTE: gcc has a a false positive here, silenced with the pragmas */
PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_IGNORED_GCC(-Wstringop-overflow)
memcpy(&instr->const_index[info->index_map[${enum}] - 1], &val, sizeof(val));
PRAGMA_DIAGNOSTIC_POP
% else:
instr->const_index[info->index_map[${enum}] - 1] = val;
% endif