This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Isolate & simplify paths with undefined behaviour
- From: Florian Weimer <fweimer at redhat dot com>
- To: Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Oct 2013 09:58:48 +0200
- Subject: Re: [RFC] Isolate & simplify paths with undefined behaviour
- Authentication-results: sourceware.org; auth=none
- References: <52616BFC dot 6010205 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1310182019300 dot 4203 at laptop-mg dot saclay dot inria dot fr> <52618D60 dot 9090101 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1310182151270 dot 4203 at laptop-mg dot saclay dot inria dot fr> <5266CB40 dot 9000604 at redhat dot com>
On 10/22/2013 09:00 PM, Jeff Law wrote:
So I was poking at this a bit. It's trival to use infer_nonnull_range
and to teach infer_nonnull_range to use the returns_nonnull attribute to
pick up that return x in an appropriately decorated function implies
that x is non-null.
We'll need a better place to shove infer_nonnull_range so that it's
available to both users.
Could you keep in mind that there is considerable interest in a
check_nonnull attribute which marks values (parameters, return values,
maybe even struct fields) that can be NULL and need to be checked
explictly prior to dereference? GCC would then warn if there is a path
on which the check is missing.
I don't have time at the moment to work on this, but it's on my
ever-growing TODO list. :)
Florian Weimer / Red Hat Product Security Team