http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54582
--- Comment #8 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-02-06 13:39:32 UTC --- (In reply to comment #7) > Because object sizes are finalized only during the objsz pass, after lots of > optimization passes. Note, as I said earlier, what matters most is that the > check is performed at runtime in that case and thus the source code bug can't > be exploited. The warning is just to let the user know earlier than at > runtime, when easily possible. Maybe we are talking about different things. cppcheck seems to be able to give the warning without any optimizations. The FE doesn't know that buf[2] is length 2 and "ab" is length 3?