Re: suggestion: c compiler warning for failure to test result

2017-04-27 Thread Joe Perches
On Thu, 2017-04-27 at 10:42 -0600, Jeff Law wrote: > 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: > > > > > > __attribute__((warn_unused_result)) > > > > > > might be > > > > > >

Re: suggestion: c compiler warning for failure to test result

2017-04-27 Thread Jeff Law
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: __attribute__((warn_unused_result)) might be __attribute__((warn_untested_result)) for things like allocation failures that are not verified before use. I agree

Re: suggestion: c compiler warning for failure to test result

2017-04-25 Thread Martin Sebor
On 04/25/2017 02:35 PM, Joe Perches wrote: A possibly useful addition similar to: __attribute__((warn_unused_result)) might be __attribute__((warn_untested_result)) for things like allocation failures that are not verified before use. I agree that this would be a useful feature. In fact,

suggestion: c compiler warning for failure to test result

2017-04-25 Thread Joe Perches
A possibly useful addition similar to: __attribute__((warn_unused_result)) might be __attribute__((warn_untested_result)) for things like allocation failures that are not verified before use. For instance: void *malloc(size_t size); could become void *