https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35503

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
I don't think the current implementation of the warning is prone to false
positives so it seems that it could safely be included it in -Wall. 
Unfortunately, the overly simplistic implementation makes it prone to many
false negatives (in fact, the warning detects only the most basic cases where
the pointer arguments are the same), making it useful for not much more than
demos.  To make it suitable for more than that it will need to be moved from
the front-end to the middle-end.

The request should probably also not be considered fully resolved until the
motivating example comment #0 (printf(buf, "%s-%s", buf, to_add)) is diagnosed.
 I think that should actually be fairly easily doable in the
gimple-ssa-sprintf.c pass.

Reply via email to