New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc] -Warray-bounds= in libc/src/string/memory_utils/op_builtin.h #76877
Comments
The reason it's not erroring on writing a single char is because the I'm not sure how it's ending up with 32 as the size for the array, the version of |
This looks like another instance of llvm-project/libc/src/string/memory_utils/utils.h Lines 82 to 99 in 79e6231
|
GCC reports an instance of -Warray-bounds in block_offset. Reimplement block_offset in terms of memcpy_inline which was created to avoid this diagnostic. See the linked issue for the full trace of diagnostic. Fixes: #76877
GCC reports an instance of -Warray-bounds in block_offset. Reimplement block_offset in terms of memcpy_inline which was created to avoid this diagnostic. See the linked issue for the full trace of diagnostic. Fixes: llvm/llvm-project#76877
building with GCC produces the following diagnostic:
FWICT,
Memcpy::block_offset
falls back to a element by element copy ifLLVM_LIBC_HAS_BUILTIN_MEMCPY_INLINE
is not defined (hence this only being reproducible with GCC).IIUC, it looks like
inline_memcpy_x86
is generating a 32 element Memcpy (Size = 32), which indeed would read outside of src for a string literal like is done inconvert_inf_nan
in that case, I don't see why
doesn't warn since
sign_char
is achar
.I'm not sure yet if this can/should be fixed in
convert_inf_nan
,Memcpy
, or somewhere else. But we need to fix this to re-enable -Werror in #74506cc @gchatelet @michaelrj-google
The text was updated successfully, but these errors were encountered: