From 34e7fa2fe62e413997776ee02a8ba38d8bdf22f6 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Thu, 13 Nov 2025 03:55:29 +0800 Subject: [PATCH] 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 Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_intrinsics_indices_h.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics_indices_h.py b/src/compiler/nir/nir_intrinsics_indices_h.py index 115cd5d0304..96f5689b560 100644 --- a/src/compiler/nir/nir_intrinsics_indices_h.py +++ b/src/compiler/nir/nir_intrinsics_indices_h.py @@ -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