Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Oct 2009 01:07:07 +0400
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Roman Divacky <rdivacky@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
Message-ID:  <20091021210707.GB5410@edoofus.dev.vega.ru>
In-Reply-To: <200910211707.n9LH7kHx005204@svn.freebsd.org>
References:  <200910211707.n9LH7kHx005204@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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".
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:

%%%
Index: bsd.sys.mk
===================================================================
--- bsd.sys.mk	(revision 198170)
+++ bsd.sys.mk	(working copy)
@@ -11,7 +11,7 @@
 # the default is gnu99 for now
 CSTD		?= gnu99
 
-.if !defined(NO_WARNS) && ${CC} != "icc"
+.if ${CC} != "icc"
 . if ${CSTD} == "k&r"
 CFLAGS		+= -traditional
 . elif ${CSTD} == "c89" || ${CSTD} == "c90"
@@ -23,6 +23,8 @@
 . else
 CFLAGS		+= -std=${CSTD}
 . endif
+.endif
+.if !defined(NO_WARNS) && ${CC} != "icc"
 # -pedantic is problematic because it also imposes namespace restrictions
 #CFLAGS		+= -pedantic
 . if defined(WARNS)
%%%

>   Tested by:	make universe
>   Approved by:	ed (maintainer)
>   OK by:		das
> 
> Modified:
>   head/share/mk/bsd.sys.mk
> 
> Modified: head/share/mk/bsd.sys.mk
> ==============================================================================
> --- head/share/mk/bsd.sys.mk	Wed Oct 21 16:12:09 2009	(r198334)
> +++ head/share/mk/bsd.sys.mk	Wed Oct 21 17:07:46 2009	(r198335)
> @@ -11,7 +11,7 @@
>  # the default is gnu99 for now
>  CSTD		?= gnu99
>  
> -.if !defined(NO_WARNS) && ${CC} != "icc"
> +.if !defined(NO_WARNS) || ${CC} != "icc"
>  . if ${CSTD} == "k&r"
>  CFLAGS		+= -traditional
>  . elif ${CSTD} == "c89" || ${CSTD} == "c90"
> 

-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091021210707.GB5410>