From owner-svn-src-head@FreeBSD.ORG Thu Oct 22 11:48:38 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B3F106566B; Thu, 22 Oct 2009 11:48:38 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE4C8FC1E; Thu, 22 Oct 2009 11:48:38 +0000 (UTC) Received: from [10.100.124.99] (port=63272 helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1N0w9l-000Cjh-6Q; Thu, 22 Oct 2009 15:48:37 +0400 Date: Thu, 22 Oct 2009 15:48:32 +0400 From: Ruslan Ermilov To: Roman Divacky Message-ID: <20091022114832.GA21442@edoofus.dev.vega.ru> References: <200910211707.n9LH7kHx005204@svn.freebsd.org> <20091021210707.GB5410@edoofus.dev.vega.ru> <20091022070638.GA97875@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091022070638.GA97875@freebsd.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r198335 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 11:48:38 -0000 Hi, On Thu, Oct 22, 2009 at 09:06:38AM +0200, Roman Divacky wrote: > On Thu, Oct 22, 2009 at 01:07:07AM +0400, Ruslan Ermilov wrote: > > On Wed, Oct 21, 2009 at 05:07:46PM +0000, Roman Divacky wrote: > > > Author: rdivacky > > > Date: Wed Oct 21 17:07:46 2009 > > > New Revision: 198335 > > > URL: http://svn.freebsd.org/changeset/base/198335 > > > > > > Log: > > > Set CSTD in all cases except when CC=icc and NO_WARNS is set. This > > > way we can set desired C standard even for cross tools etc. > > > > > I think you meant to say "always set CFLAGS based on CSTD". > > Unfortunately the actual change does not only that, it also > > breaks NO_WARNS (by ignoring it) for anything that's not "icc". > > yes, it sets the C standard regardless of NO_WARNS But it does NOT only that, it also causes NO_WARNS to be a no-op (see below). > > It also breaks "icc" compiles without NO_WARNS by passing > > unrecognized flags to the compiler. A correct change would > > be to move setting of CFLAGS based on CSTD out of the control > > of NO_WARNS, like this: > > previously it did: > > NO_WARNS ICC CFLAGS includes CSTD > 0 0 1 > 0 1 0 > 1 0 0 > 1 1 0 > > > now it does > > NO_WARNS ICC CFLAGS includes CSTD > 0 0 1 > 0 1 1 > 1 0 1 > 1 1 0 > > so you are saying that for ICC and !NO_WARNS the CFLAGS should not > include CSTD? ie: > > NO_WARNS ICC CFLAGS includes CSTD > 0 0 1 > 0 1 0 > 1 0 1 > 1 1 0 > > am I right? my intention was to set the C standard regardless of NO_WARNS > for "clang" (because it default to C99 and gcc breaks with it). I understand your intentions. icc has different command-line options to support conformance to standards, mostly incompatible with gcc. >From a manpage: : -ansi : Support all ANSI standard C programs, equivalent to the -ansi option of gcc. : -[no-]c99 : Enable [disable] C99 support for C programs. : -std=c99 : Enable C99 support for C programs : -strict-ansi : Select strict ANSI C/C++ conformance dialect > feel free to fix my commit if this is the case Your commit also causes warning options (those starting with -W) to leak into CFLAGS when NO_WARNS is set, thus making NO_WARNS a no-op, and that is a bigger problem I was talking about. Before your change: # make -f bsd.own.mk -f bsd.sys.mk WARNS=6 -DNO_WARNS CSTD=c99 -V CFLAGS -O2 -pipe -fstack-protector After your change: # make -f bsd.own.mk -f bsd.sys.mk WARNS=6 -DNO_WARNS CSTD=c99 -V CFLAGS -O2 -pipe -std=iso9899:1999 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign With my fix: # make -f bsd.own.mk -f bsd.sys.mk WARNS=6 -DNO_WARNS CSTD=c99 -V CFLAGS -O2 -pipe -std=iso9899:1999 -fstack-protector FYI, I've committed my fix. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer