svn commit: r335278 - head/bin/pwd

Eitan Adler eadler at freebsd.org
Sun Jun 17 20:47:41 UTC 2018


On 16 June 2018 at 23:54, Bruce Evans <brde at optusnet.com.au> wrote:
> On Sun, 17 Jun 2018, Eitan Adler wrote:
>
>> Log:
>>  pwd: mark usage as dead
>>
>> Modified:
>>  head/bin/pwd/pwd.c
>>
>> Modified: head/bin/pwd/pwd.c
>>
>> ==============================================================================
>> --- head/bin/pwd/pwd.c  Sun Jun 17 03:33:29 2018        (r335277)
>> +++ head/bin/pwd/pwd.c  Sun Jun 17 05:14:50 2018        (r335278)
>> @@ -95,7 +95,7 @@ main(int argc, char *argv[])
>>         exit(0);
>> }
>>
>> -void
>> +void __dead2
>> usage(void)
>> {
>
>
> I asked you to back out a previous addition of __dead2 about 20 additions
> of it ago.
>
> __dead2 here has no effect.  The compiler can see that usage() doesn't
> return if it understands __dead2 at all, since usage() ends with exit()
> which is declared as __dead2.

You are correct that this doesn't do much for the compiler. On the
other hand it does shut up clang and some other static analyzers. It
also doesn't cause any harm, so I don't see why it should be removed.


Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams


More information about the svn-src-all mailing list