https://bugs.kde.org/show_bug.cgi?id=401284

--- Comment #8 from AL <l...@ncbi.nlm.nih.gov> ---
> $ gcc -O2 -Wall -g -o vbug vbug.c
> vbug.c: In function ‘main’:
> vbug.c:10:5: warning: ‘strncat’ accessing between 1 and 9223372036854775805 
> bytes at offsets [0, 9223372036854775805] and 0 may overlap 1 byte at offset 
> [0, 9223372036854775807] [-Wrestrict]

Starting with some later versions, GCC have gone to some great extreme with
both their warnings and the usefulness of such, which is borderline absurdish,
at times -- just try to take a look at the bounds above...

> An implementation might copy 8 bytes at a time if len == 7

Okay, let's say this is the case, then the code still works correctly,
overwriting the ending '\0' byte in dst (which also happens to be shared with
src) -- but that's what was going to happen, anyways.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to