Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Oct 2011 14:40:47 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        =?ISO-8859-1?Q?Ren=E9_Ladan?= <rene@freebsd.org>, freebsd-current@freebsd.org, Larry Rosenman <ler@lerctr.org>
Subject:   Re: System headers with clang?
Message-ID:  <CACqU3MWzq7JGWzqsAZsvW8BCHy-ZrahSkOyoW7n4p%2BFYbVH34A@mail.gmail.com>
In-Reply-To: <4E9449F2.2000801@FreeBSD.org>
References:  <alpine.BSF.2.00.1110091229550.43656@lrosenman.dyndns.org> <4E942FF1.9000805@FreeBSD.org> <alpine.BSF.2.00.1110110830200.21480@lrosenman.dyndns.org> <4E9449F2.2000801@FreeBSD.org>

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

On Tue, Oct 11, 2011 at 9:51 AM, Dimitry Andric <dim@freebsd.org> wrote:
> On 2011-10-11 15:31, Larry Rosenman wrote:
>>
>> On Tue, 11 Oct 2011, Dimitry Andric wrote:
>
> ...
>>>
>>> I've attached a fix for the lsof port, which also makes it build on
>>> 10.0-CURRENT (this was easy to fix here, as lsof uses its own
>>> hand-rolled configuration script). =A0Let me know if it works for you.
>>>
>> Unless the headers are fixed, Vic Abell (lsof Author) will NOT support i=
t.
>>
>> We need to get clang/system headers to allow warning free compilation
>> just like GCC does.
>
> The system headers compile without warning, if you use them as intended
> (e.g. from the kernel), which lsof obviously doesn't do. =A0There is no
> easy workaround here, except by modifying lsof.
>
> For example, the warning about KASSERT is because lsof's headers don't
> include the required headers for this macro. =A0And gcc is apparently not
> smart enough to generate warnings for this. :)
>
KASSERT() (from `sys/systm.h') is kernel only, any userland code
seeing it is not using the header properly. I'd be a strong proponent
of:

#ifdef _KERNEL
#error "You are NOT meant to define _KERNEL in userland application"
#endif

So this has nothing to do about smartness, but correctness.

 - Arnaud



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MWzq7JGWzqsAZsvW8BCHy-ZrahSkOyoW7n4p%2BFYbVH34A>