From owner-freebsd-current@FreeBSD.ORG Mon Feb 18 05:58:32 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9BAA1495 for ; Mon, 18 Feb 2013 05:58:32 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by mx1.freebsd.org (Postfix) with ESMTP id 04070DC9 for ; Mon, 18 Feb 2013 05:58:31 +0000 (UTC) Received: by mail-ee0-f42.google.com with SMTP id b47so2644949eek.29 for ; Sun, 17 Feb 2013 21:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=D8JVVNLKseKS5RmmZwtpNBi8PdSOql6hY52dP5ANw18=; b=G8iPrUCz48PiaDZn/ZztreyA3GHFVs8v8j/SVUr2zypqNRm+pvI493CwS30Yisko+i VrrPxCjUrB0o87o5IvpAdOWbCPRTGD/LiQSf34KnA/IDNgrjloMNAuJeuMhiH5x86ILc jG+9wnaVUe6yUQIptAi3c5N/0UpeyOp2aMzVroVG4XAEoH6XmoOvlFiA0X83MLUJ+9qG Y6fU7mMtYSJQtXuH3HFdlGi3r77u0gxd4FNdFhUunpEqwKBmu0U3hqGrhzfFwUkskNA0 VSr+CJYYpA/ZEF4/dkBuwSFw6JNTCABaxrsmExAbG3GJTaxy3m31Osv2Feym34JiYRRA 4/Gw== X-Received: by 10.14.219.7 with SMTP id l7mr16954173eep.12.1361167105288; Sun, 17 Feb 2013 21:58:25 -0800 (PST) Received: from [192.168.1.80] (54021263.dsl.pool.telekom.hu. [84.2.18.99]) by mx.google.com with ESMTPS id 3sm96546486eej.6.2013.02.17.21.58.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 17 Feb 2013 21:58:23 -0800 (PST) Message-ID: <5121B4F3.8020008@gmail.com> Date: Mon, 18 Feb 2013 05:58:27 +0100 From: deeptech71 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:18.0) Gecko/20100101 SeaMonkey/2.15 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: the latest version of Clang/LLVM for the world and kernel References: <511E378E.3090200@gmail.com> <511E5B05.5050402@FreeBSD.org> <511EBEFE.5010406@gmail.com> <511FB105.7040004@FreeBSD.org> In-Reply-To: <511FB105.7040004@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 18 Feb 2013 05:58:32 -0000 On 02/16/2013 17:17, Dimitry Andric wrote: > On 2013-02-16 00:04, deeptech71 wrote: >> First of all, you should understand that these are compilation errors > > No, they are only errors because we have turned on -Werror. You meant to say: Yes, but they are only errors because we have turned on -Werror. > Regarding this particular warning, it could be fixed by casting status > to int, or adding -Wno-tautological-constant-out-of-range-compare to the > flags for its WARNS= level (which is 2, if I looked it up correctly). I'd change the variable to an int. >> Second of all, you should understand that these are real errors; in this case, the compiler may omit generating code to check for a boolean condition, if the value of that condition is known at compile time, and thus generating a program with an undesired mode of operation. > > No, this is not the case with enums, unless you use the -fstrict-enums > flag, which we don't use at the moment. And even with that flag, I did > not see any change in the resulting assembly. > > This is probably because it would break too much software, if such an > optimization was implemented, even if that optimization is strictly > speaking completely legal to do. What makes you think that no semantic changes will occur in the future? What about other compilers? As the makefile comments say, some warnings are kept enabled to create an incentive to fix the code. But the real incentive should be that fixing the code makes the difference between WRONG and non-WRONG. >>>> * /usr/src/lib/libugidfw/ugidfw.c:74:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare] >>>> * if (len < 0 || len > left) >>>> * ~~~ ^ ~ > > Normally, they are not errors, but just warnings, unless you changed > something in the bsd.*.mk logic to not detect clang. WRONG. Clang detection measures are intact here: /etc/make.conf contains: CC=/dir1/clang CPP=/dir1/clang-cpp CXX=/dir1/clang++ TBLGEN=/dir1/clang-tblgen