Unjustified warning?

Marcel Keller m.keller@bristol.ac.uk
Fri Dec 15 00:35:00 GMT 2017


Hi,

Compiling the attached code with GCC 7.2 (Ubuntu 17.10) gives the 
following warning:

$ g++ -mavx -O3 foo.cpp -c
In function ‘void foo(size_t)’:
cc1plus: warning: ‘void* __builtin_memset(void*, int, long unsigned 
int)’: writing between 32 and 18446744073709551584 bytes into a region 
of size 16 overflows the destination [-Wstringop-overflow=]

However, the length in the memset call would be between 1 and 31, and 
the range 1 to 16 should be fine, as far as I can tell. Should that be 
considered a bug?

Best regards,
Marcel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.cpp
Type: text/x-c++src
Size: 344 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20171215/77eb9dda/attachment.bin>


More information about the Gcc-help mailing list