[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2017-01-08 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 --- Comment #10 from Martin Sebor --- Author: msebor Date: Sun Jan 8 23:42:09 2017 New Revision: 244210 URL: https://gcc.gnu.org/viewcvs?rev=244210&root=gcc&view=rev Log: PR tree-optimization/78913 - Probably misleading error reported by -Wform

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2017-01-03 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 Martin Sebor changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2017-01-03 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 Martin Sebor changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org --- Com

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2017-01-02 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 Martin Sebor changed: What|Removed |Added Status|WAITING |NEW --- Comment #7 from Martin Sebor ---

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2017-01-02 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 --- Comment #6 from Martin Liška --- (In reply to Martin Sebor from comment #5) > (In reply to Martin Sebor from comment #4) > > 1) use the %.508s directive instead of %s, or > > 2) verify the snprintf return value is less than 512. > > Whoops.

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2017-01-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 --- Comment #5 from Martin Sebor --- (In reply to Martin Sebor from comment #4) > 1) use the %.508s directive instead of %s, or > 2) verify the snprintf return value is less than 512. Whoops. An off-by-one error. I meant to follow that by: >

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2017-01-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 --- Comment #4 from Martin Sebor --- I'm not sure I do understand exactly what you mean. The warning in this specific case is a false positive. There is no easy way for GCC to avoid it without compromising the checker's efficacy in general. (T

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2016-12-27 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 --- Comment #3 from Martin Liška --- Well, I understand that char[x] can potentially be at most x-1 characters long. On the other hand, it's quite common case where one uses a temporary buffer (reasonable big) which is used by sprintf-family func

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2016-12-23 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 --- Comment #2 from Martin Sebor --- I should have mentioned: the -Wformat-length pass would benefit from the results of the strlen pass. It would also benefit from better range information. Having the pass run later, after the VRP pass, would

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-length

2016-12-23 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913 Martin Sebor changed: What|Removed |Added Keywords||diagnostic Status|UNCONFIRMED