Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jun 2018 11:14:56 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Eitan Adler <eadler@freebsd.org>
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:  <4fc7f1df-ba00-0213-d3f4-2ab5c5114b6c@FreeBSD.org>
In-Reply-To: <CAF6rxgnQgb4NNoamBxrraOTBTt-nds-zkb2tdPxWi1=wbouv=g@mail.gmail.com>
References:  <201806170514.w5H5Epts050842@repo.freebsd.org> <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> <CAF6rxgnQgb4NNoamBxrraOTBTt-nds-zkb2tdPxWi1=wbouv=g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/18/18 10:26 PM, Eitan Adler wrote:
> On 18 June 2018 at 10:57, John Baldwin <jhb@freebsd.org> wrote:
>> On 6/16/18 10:14 PM, Eitan Adler wrote:
>>> Author: eadler
>>> Date: Sun Jun 17 05:14:50 2018
>>> New Revision: 335278
>>> URL: https://svnweb.freebsd.org/changeset/base/335278
>>>
>>> Log:
>>>   pwd: mark usage as dead
>>
>> You keep committing changes like this and ignoring e-mails about them.
> 
> I replied both the first time and this time. I may have
> (accidentally?) ignored similar emails though. The question I have is
> other than the mild code churn what's the harm?
> 
>> What broken compiler are you using that doesn't properly inherit __dead2
>> from the call to exit()?
> 
> In this case, scan-build50 was getting annoyed.

In this case, someone in a private reply suggested that marking
usage 'static' is probably the better fix than marking it __dead2.
If that change satisfies scan-build then I think that is a better
approach.

Also, the proper place for __dead2 if you were going to use it would
be on the prototype, not the definition.  That is, if usage() were
intended to be an exported function like abort() or exit(), then you
want to mark the prototype in the header as __dead2 so that the
compiler will understand that those functions don't return.  However,
that annotation is only useful on the prototype, not the definition.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4fc7f1df-ba00-0213-d3f4-2ab5c5114b6c>