svn commit: r300935 - head/usr.sbin/rpc.statd

Ed Schouten ed at nuxi.nl
Sun May 29 10:39:28 UTC 2016


Hi Bruce, Garrett,

2016-05-29 9:31 GMT+02:00 Bruce Evans <brde at optusnet.com.au>:
> On Sun, 29 May 2016, Garrett Cooper wrote:
>
>> Log:
>>  Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call
>> exit
>>  as a hint to static analysis tools
>
> This is bogus for usage() since it is static so only very broken static
> analyis tools can't see its full details.

Exactly. I think it's important to keep in mind what the intent of
this attribute is: to pass compiler optimization state across
compilation units. For static functions, this has absolutely no
meaning.

Also, as we already live in the year 2016, please use the following
construct in case you really want to mark this function as no-return:

#include <stdnoreturn.h>

static noreturn void usage(void)
{
    ...
}

In public header files where you likely don't want to pollute the
namespace, use _Noreturn instead.

Thanks,
-- 
Ed Schouten <ed at nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717


More information about the svn-src-head mailing list