From owner-freebsd-current@FreeBSD.ORG Tue Oct 11 18:40:49 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F38D1065673; Tue, 11 Oct 2011 18:40:49 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A204D8FC19; Tue, 11 Oct 2011 18:40:48 +0000 (UTC) Received: by wyj26 with SMTP id 26so11532277wyj.13 for ; Tue, 11 Oct 2011 11:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=1/SLqGFAWCWQbIBFC3KYivEPOWBUpYsTlsImfhv8Qrw=; b=I89J5U1eytmd2CaBKF48aBaaj6CGn1iMePH8BQM/feQ90HU2jk+TXtZu0gA1xYIZc4 /6VXmXwUPvQmj0qlx0LXUYURSdLRnOrPdBzrFBk05paDf3eseer/o/WqV424GBlH1yON +/5dizwe1Sy7Ikgsqp/TKw0HEhQq0rAWFEdkw= MIME-Version: 1.0 Received: by 10.227.134.18 with SMTP id h18mr8135576wbt.49.1318358447430; Tue, 11 Oct 2011 11:40:47 -0700 (PDT) Received: by 10.180.103.33 with HTTP; Tue, 11 Oct 2011 11:40:47 -0700 (PDT) In-Reply-To: <4E9449F2.2000801@FreeBSD.org> References: <4E942FF1.9000805@FreeBSD.org> <4E9449F2.2000801@FreeBSD.org> Date: Tue, 11 Oct 2011 14:40:47 -0400 Message-ID: From: Arnaud Lacombe To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-1?Q?Ren=E9_Ladan?= , freebsd-current@freebsd.org, Larry Rosenman Subject: Re: System headers with clang? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 18:40:49 -0000 Hi, On Tue, Oct 11, 2011 at 9:51 AM, Dimitry Andric 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