Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2018 13:47:10 -0700
From:      Eitan Adler <eadler@freebsd.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r335278 - head/bin/pwd
Message-ID:  <CAF6rxgnxu94jTcwAf=0KDJBaKAXWS-udWQupK64OWGbR2c12PA@mail.gmail.com>
In-Reply-To: <20180617161907.Y1464@besplex.bde.org>
References:  <201806170514.w5H5Epts050842@repo.freebsd.org> <20180617161907.Y1464@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16 June 2018 at 23:54, Bruce Evans <brde@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxgnxu94jTcwAf=0KDJBaKAXWS-udWQupK64OWGbR2c12PA>