Kees Cook <k...@kernel.org> writes: > On Thu, Apr 10, 2025 at 05:17:51PM -0700, Keith Packard wrote: >> A target using 16-bit ints won't have enough bits to hold the whole >> flag_sanitize set. Be explicit about using uint32 for the attribute data. >> >> Signed-off-by: Keith Packard <kei...@keithp.com> >> --- >> gcc/c-family/c-attribs.cc | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc >> index 5a0e3d328ba..2a4ae10838a 100644 >> --- a/gcc/c-family/c-attribs.cc >> +++ b/gcc/c-family/c-attribs.cc >> @@ -1420,12 +1420,12 @@ add_no_sanitize_value (tree node, unsigned int flags) >> if (flags == old_value) >> return; >> >> - TREE_VALUE (attr) = build_int_cst (unsigned_type_node, flags); >> + TREE_VALUE (attr) = build_int_cst (uint32_type_node, flags); >> } >> else >> DECL_ATTRIBUTES (node) >> = tree_cons (get_identifier ("no_sanitize"), >> - build_int_cst (unsigned_type_node, flags), >> + build_int_cst (uint32_type_node, flags), >> DECL_ATTRIBUTES (node)); >> } > > This looks correct to me. Martin, is this something you (or someone > else) can get committed for GCC 15?
Martin isn't involved with GCC development anymore. But it's not clear to me why this is critical for GCC 15. (Any further patches for 15.1 need to be both approved and then approved by release managers). Did you need this for something on the Linux side? More likely that if approved, it could then go into 15.2 which will be in a few months (not a year unlike > X.3).