Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2011 13:37:25 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r229087 - stable/9/share/mk
Message-ID:  <201112311337.pBVDbPE8065478@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Dec 31 13:37:25 2011
New Revision: 229087
URL: http://svn.freebsd.org/changeset/base/229087

Log:
  MFC r228546:
  
    Clang has more warnings enabled by default, and when using -Wall, so if WARNS
    is set to low values, some of them have to be disabled explicitly.
  
  MFC r228551:
  
    Disable one more clang warning when WARNS <= 3.
  
  MFC r228606:
  
    Add a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
    to selectively work around warnings in programs that don't use flexible
    array members, but instead define arrays of length 1 at the end of the
    struct, and then access those beyond their declared bounds.
  
  MFC r228617:
  
    Disable yet another clang warning when WARNS <= 3.
  
  MFC r228675:
  
    Disable yet another clang warning (-Wconversion) when WARNS <= 3.
  
  MFC r228677:
  
    Disable another clang warning (-Wempty-body) when WARNS <= 2.

Modified:
  stable/9/share/mk/bsd.sys.mk
Directory Properties:
  stable/9/share/mk/   (props changed)

Modified: stable/9/share/mk/bsd.sys.mk
==============================================================================
--- stable/9/share/mk/bsd.sys.mk	Sat Dec 31 13:34:42 2011	(r229086)
+++ stable/9/share/mk/bsd.sys.mk	Sat Dec 31 13:37:25 2011	(r229087)
@@ -57,6 +57,24 @@ CWARNFLAGS	+=	-Wchar-subscripts -Winline
 CWARNFLAGS	+=	-Wno-uninitialized
 .  endif
 CWARNFLAGS	+=	-Wno-pointer-sign
+# Clang has more warnings enabled by default, and when using -Wall, so if WARNS
+# is set to low values, these have to be disabled explicitly.
+.  if ${CC:T:Mclang} == "clang"
+.   if ${WARNS} <= 3
+CWARNFLAGS	+=	-Wno-tautological-compare -Wno-unused-value\
+			-Wno-parentheses-equality -Wno-unused-function\
+			-Wno-conversion
+.   endif
+.   if ${WARNS} <= 2
+CWARNFLAGS	+=	-Wno-switch-enum -Wno-empty-body
+.   endif
+.   if ${WARNS} <= 1
+CWARNFLAGS	+=	-Wno-parentheses
+.   endif
+.   if defined(NO_WARRAY_BOUNDS)
+CWARNFLAGS	+=	-Wno-array-bounds
+.   endif
+.  endif
 . endif
 
 . if defined(FORMAT_AUDIT)



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