svn commit: r198335 - head/share/mk

Ruslan Ermilov ru at FreeBSD.org
Wed Oct 21 21:07:13 UTC 2009


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 at FreeBSD.org
FreeBSD committer


More information about the svn-src-head mailing list