This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sprintf warning on overlapping output


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]