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

--- Comment #3 from Thomas De Schampheleire <patrickdepinguin at gmail dot com> 
---
(In reply to Richard Biener from comment #2)
> 
> We could change the warning to have a "may be above array bounds" form
> for your case but that wouldn't handle the bar() case.

The problem with giving warnings about potential-but-not-definite issues is
that projects that compile with '-Wall -Werror' assume zero warnings to guard
quality.

But if some warnings are false-positives, this strategy no longer works. The
project will fail to compile even though it is perfectly fine.

You'd need a way to tell gcc that this code is fine, or put such cases in a
separate warning category that is not included in Wall or can be disabled
explicitly.

Reply via email to