[PATCH] detect attribute mismatches in alias declarations (PR 81824)

Joseph Myers joseph@codesourcery.com
Wed Oct 24 13:04:00 GMT 2018


On Wed, 24 Oct 2018, Martin Sebor wrote:

> /* The compiler will optimize based on the knowledge the parameter is
>    not NULL.  This will omit tests.  A robust implementation cannot allow
>    this so when compiling glibc itself we ignore this attribute.  */
> # undef __nonnull
> # define __nonnull(params)
> 
> I don't think this is actually true for recent versions of GCC.
> The nonnull optimization is controlled by
> -fisolate-erroneous-paths-attribute and according to the manual
> and common.opt the option is disabled by default.

I think -fisolate-erroneous-paths-attribute controls something different 
(generating tests and traps rather than simply optimizing on the basis of 
a parameter not being NULL).

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list