Commit 60e25cf0 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

Specific versions of gcc (g++) have a bug that incorrectly warns with

-Wextra as follows: "[class name] has a field [member name] whose type
uses the anonymous namespace", even if the anonymous namespqce in
question is closed in the single translation unit:

AFAICS, the intent was to warn it if the anonymous namespace is used
in a header file (which can easily violate the One Definition Rule as
discussed in the bugzilla), but gcc seemingly did too much to prevent

Unfortunately this bug prohibits us from specifying -Werror, so we
selectively disable this flag by identifying g++ used for build has
this bug.

git-svn-id: svn:// e5f2f494-b856-4b98-b285-d166d9295462
parent 698ee48c
......@@ -25,8 +25,23 @@ AM_PATH_PYTHON([3.1])
if test "X$GCC" = "Xyes"; then
CXXFLAGS="$CXXFLAGS -g -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
# Certain versions of gcc (g++) have a bug that incorrectly warns about
# the use of anonymous name spaces even if they're closed in a single
# translation unit. For these versions we have to disable -Werror.
AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
AC_TRY_COMPILE([namespace { class Foo {}; }
namespace isc {class Bar {Foo foo_;};} ],,
AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused)
AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
# produce PIC unless we disable shared libraries. need this for python bindings.
if test $enable_shared != "no" -a "X$GCC" = "Xyes"; then
SUBDIRS = . tests
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext -Werror
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext
AM_CPPFLAGS += -Werror
CLEANFILES = *.gcno *.gcda
CLEANFILES += rrclass.h rrtype.h rdataclass.h
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment