This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/17308] nonnull attribute not as useful as it could


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308

--- Comment #9 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-04-25 20:00:44 UTC ---
(In reply to comment #8)
> Even if you decide that you are unable to warn about a call to foo(var) because
> the only way to analyze that var might be NULL is in the middle end but the
> warning is only emitted by the front end, AT LEAST you could have warned that
> the 'if (!bar)' conditional is assumed to be dead code based on the attribute
> placed on var.

GCC does not warn about unreachable code anymore:

http://gcc.gnu.org/ml/gcc-help/2011-05/msg00360.html

Someone would have to contribute a new -Wunreachable-code implementation. I
honestly don't know what kind of implementation would be acceptable by GCC
maintainers. Maybe one implemented in the FE? If so, it would require exactly
the same infrastructure necessary to implement what Ulrich asks for above.

Sorry, comment #7 still applies.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]