sprintf warning on overlapping output

Bernd Edlinger bernd@edlinger-online.de
Sun Sep 25 09:46:00 GMT 2016


Hi Martin,

in the past I have seen (and fixed) code like

sprintf(buf, "%s %d", buf, x);

that may possibly work by chance, but usually
produces undefined results.

Do you see a way to enhance the warning for cases
where the output buffer overlaps an input buffer?



Thanks
Bernd.



More information about the Gcc mailing list