[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2019-11-12 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #9 from Martin Sebor --- Author: msebor Date: Tue Nov 12 17:18:37 2019 New Revision: 278098 URL: https://gcc.gnu.org/viewcvs?rev=278098&root=gcc&view=rev Log: PR middle-end/83688 - check if buffers may overlap when copying strings us

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2019-10-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 Martin Sebor changed: What|Removed |Added Keywords||patch --- Comment #8 from Martin Sebor -

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #7 from Daniel Fruzynski --- In general case yes, this can produce a lot of false positives. I wanted to use this only for strings stored in fixed-size buffer. Existing string-related warnings already uses this information, and this r

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #6 from Martin Sebor --- The warning does see that range (it's in the output of the -fdump-tree-vrp option). The challenge with using ranges is to avoid false positives from excessive bounds. For sizes, typically only the lower boun

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #5 from Daniel Fruzynski --- > There is nothing to indicate that the first call to memcpy() in comment #0 > overlaps so -Wrestrict doesn't warn for it. I thought that fix for bug 83373 will somehow help here. gcc could guess that mem

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #4 from Martin Sebor --- There is nothing to indicate that the first call to memcpy() in comment #0 overlaps so -Wrestrict doesn't warn for it. One thing to note is that the warning treats raw memory functions slightly differently th

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #3 from Daniel Fruzynski --- Looks that something is not working properly. I have pasted output from compilation of function in 1st post, and -Wrestrict complained only about last memcpy call. Please take a look on this. BTW, string

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 Martin Sebor changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at