[Bug c/45879] strcpy returns unexpected result
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 7 19:25:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45879
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 8.1 diagnoses the bug with -Wrestrict:
pr45879.c: In function ‘main’:
pr45879.c:12:7: warning: ‘strcpy’ accessing 5 bytes at offsets 4 and 5 overlaps
4 bytes at offset 5 [-Wrestrict]
strcpy(&data[4], &data[5]);
^~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the Gcc-bugs
mailing list