mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 04:20:18 +01:00
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:
parent
e231aec0c9
commit
34e7fa2fe6
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue