Unjustified warning?
Marcel Keller
m.keller@bristol.ac.uk
Fri Dec 15 11:55:00 GMT 2017
> The warning isn't caused by the explicit memset but rather by GCC
> introducing one within the loop. I'm not sure that the warning
> itself should be considered a bug. If the function is called with
> length greater than or equal to 32 it will overflow. So I'd say
> the warning is helpful in pointing it out. What's not helpful
> is the missing location information, compounded by the fact that
> the only memset call in the source code isn't what causes it.
>
> To avoid the warning make sure foo() calls avx_memzero with
> a length of at most the size of bar.
Thank you for the clarification. If I limit the length as in the code
attached, I still get the warning however.
Best regards,
Marcel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.cpp
Type: text/x-c++src
Size: 387 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20171215/2eef8810/attachment.bin>
More information about the Gcc-help
mailing list