Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2011 09:01:09 +0100
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        freebsd-current@freebsd.org
Subject:   Re: FYI: clang static analyzer page has moved to http://scan.freebsd.your.org/freebsd-head/
Message-ID:  <7FA66A47-CB15-4C22-8614-B58E986CFFA4@cederstrand.dk>
In-Reply-To: <20110105193653.GA49285@stack.nl>
References:  <20110105131439.GN23329@acme.spoerlein.net> <4184C8F2-3C6D-46FB-8F10-DDEBA6DB1C35@cederstrand.dk> <AD2AEFFB-37A4-4DAB-9094-7289C1C8B0DD@cederstrand.dk> <201101050934.49845.jhb@freebsd.org> <20110105165545.GP23329@acme.spoerlein.net> <20110105193653.GA49285@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-140-313573145
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1


Den 05/01/2011 kl. 20.36 skrev Jilles Tjoelker:

> On Wed, Jan 05, 2011 at 05:55:45PM +0100, Ulrich Sp=F6rlein wrote:
>> On Wed, 05.01.2011 at 09:34:49 -0500, John Baldwin wrote:
>>> These are all marked as __dead2, so the compiler should "know" that =
these do
>>> not return.
>=20
>> And clang did the right thing here in the past. Beware that it does =
no
>> inter-procedural analysis yet, so it will usually miss that usage()
>> calls exit unconditionally.
>=20
>> *But*, it should grok that for err(3) and exit(3). Now there are some
>> possible remedies:
>=20
>> - get IPA to work with clang, or at least file a bug
>=20
>> - mark functions as __dead2 (please don't do that)
>=20
> Why not?

Because the analyzer is supposed to find bugs. Only the function that =
really doesn't return should be marked as such. If we begin spewing =
__dead2's everywhere, it's bound to silence a valid bug somewhere down =
the line when e.g. a conditional in a print_help() function is changed =
subtly so it doesn't always reach exit().

Erik=

--Apple-Mail-140-313573145--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7FA66A47-CB15-4C22-8614-B58E986CFFA4>