devd(8): Add -Wno-unused-local-typedefs to CFLAGS for now.
authorSascha Wildner <saw@online.de>
Thu, 26 Feb 2015 10:47:05 +0000 (11:47 +0100)
committerSascha Wildner <saw@online.de>
Thu, 26 Feb 2015 10:47:05 +0000 (11:47 +0100)
The issue is that with -Wunused-local-typedefs, our GCC 5.0 warns about
unused local typedefs in its own headers, in this case stl_algo.h which
comes in via <algorithm>, which devd(8) includes.

Example:

c++ [...] -Werror -Wall [...] -c devd.cc
In file included from /usr/include/c++/5.0/bits/stl_algo.h:61:0,
                 from /usr/include/c++/5.0/algorithm:62,
                 from devd.cc:93:
/usr/include/c++/5.0/bits/stl_heap.h: In function 'void std::pop_heap(_RAIter, _RAIter)':
/usr/include/c++/5.0/bits/stl_heap.h:266:2: error: typedef '_ValueType' locally defined but not used [-Werror=unused-local-typedefs]
  _ValueType;
  ^
[...]

More typedefs are warned about, _InputValueType, _OutputValueType, and
_DistanceType.

sbin/devd/Makefile
share/mk/sys.mk

index 9f5348d..af0d5d7 100644 (file)
@@ -13,6 +13,12 @@ LDADD=       -ll -lutil
 
 YFLAGS+=-v
 CFLAGS+=-I. -I${.CURDIR}
+# XXX gcc50 (at least) warns about its own C++ headers with
+#     -Wunused-local-typedefs, so disable until fixed
+#
+.if (${CCVER:Mgcc4[89]} || ${CCVER:Mgcc5*})
+CXXFLAGS+=-Wno-unused-local-typedefs
+.endif
 
 CLEANFILES= y.output
 
index 28eeb5d..3996879 100644 (file)
@@ -60,12 +60,6 @@ CXX_LINK     ?=      ${CXX}
 NXCXX          ?=      ${NXENV} ${CXX}
 NXCXX_LINK     ?=      ${NXENV} ${CXX_LINK}
 CXXFLAGS       ?=      ${CXXINCLUDES} ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition}
-# XXX gcc50 (at least) warns about its own C++ headers with
-#     -Wunused-local-typedefs, so disable until fixed
-#
-.if defined(CCVER) && (${CCVER:Mgcc4[89]} || ${CCVER:Mgcc5*})
-CXXFLAGS       +=      -Wno-unused-local-typedefs
-.endif
 .if !defined(SYSBUILD) && defined(.MAKE.BUILT.BY) && ${.MAKE.BUILT.BY:Mgcc47}
 CXXFLAGS       +=      -D_GLIBCXX_USE_CXX11_ABI=0
 .endif