[PATCH 1/2] Annotate internal_error with the attribute noreturn

David Bremner david at tethera.net
Fri Sep 21 13:31:03 PDT 2012


Justus Winter <4winter at informatik.uni-hamburg.de> writes:

> Annotating functions that do not return with the noreturn attribute
> (which is understood by both gcc and clang) prevents static analyzers
> from generating false positives (internal_error is used to terminate
> the process and is used extensively in error handling code paths).
>
> Remove the return statement that was placed there to appease the
> compiler. Functions annotated with noreturn are not supposed to return
> any values.
>

This patch looks OK (although I don't know the pragma details).  Do you
(or anyone) happen to know why _internal_error is an int function?
Making it void wouldn't fix the problem with static analzers, but having
an int function without a return looks ugly to me.

d


More information about the notmuch mailing list