This is the mail archive of the
mailing list for the GCC project.
Re: suggestion: c compiler warning for failure to test result
- From: Jeff Law <law at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Joe Perches <joe at perches dot com>, gcc <gcc at gcc dot gnu dot org>
- Date: Thu, 27 Apr 2017 10:42:11 -0600
- Subject: Re: suggestion: c compiler warning for failure to test result
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=law at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2882780059
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2882780059
- References: <email@example.com> <firstname.lastname@example.org>
On 04/25/2017 05:02 PM, Martin Sebor wrote:
On 04/25/2017 02:35 PM, Joe Perches wrote:
A possibly useful addition similar to:
for things like allocation failures that
are not verified before use.
I agree that this would be a useful feature. In fact, I've been
thinking about implementing something like it, though not quite
as general. (My initial thought was to key the warning off
an existing attribute like alloc_size for functions that aren't
also decorated with returns_nonnull.) With warn_untested_result
even non-allocation functions (such as fopen) could be decorated,
so that seems like a better approach.
Can you please open an enhancement request in Bugzilla?
Yea, I like it as well.