From 88686972b9caf8fd132c4e30d89da78c3d324c27 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Sun, 4 Oct 2015 11:15:37 -0700 Subject: [PATCH] pass -fsized-deallocation to gcc 5 Otherwise it gives warning for declaration of sized delete operator. --- Makefile.am | 3 +++ configure.ac | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Makefile.am b/Makefile.am index b5f4725..70d26c8 100755 --- a/Makefile.am +++ b/Makefile.am @@ -48,6 +48,9 @@ endif GCC if HAVE_W_NO_UNUSED_RESULT AM_CXXFLAGS += -Wno-unused-result endif HAVE_W_NO_UNUSED_RESULT +if HAVE_SIZED_DEALLOCATION +AM_CXXFLAGS += -fsized-deallocation +endif HAVE_SIZED_DEALLOCATION # The -no-undefined flag allows libtool to generate shared libraries for # Cygwin and MinGW. LIBSTDCXX_LA_LINKER_FLAG is used to fix a Solaris bug. diff --git a/configure.ac b/configure.ac index e838511..1148c21 100644 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,19 @@ AC_CACHE_CHECK([if the compiler supports -Wno-unused-result], AM_CONDITIONAL(HAVE_W_NO_UNUSED_RESULT, test "$perftools_cv_w_no_unused_result" = yes) +AC_CACHE_CHECK([if C++ compiler supports -fsized-deallocation], + perftools_cv_sized_deallocation_result, + [AC_LANG_PUSH(C++) + OLD_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fsized-deallocation" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], + perftools_cv_sized_deallocation_result=yes, + perftools_cv_sized_deallocation_result=no) + CXXFLAGS="$OLD_CXXFLAGS" + AC_LANG_POP(C++)]) +AM_CONDITIONAL(HAVE_SIZED_DEALLOCATION, + test "$perftools_cv_sized_deallocation_result" = yes) + # Defines PRIuS AC_COMPILER_CHARACTERISTICS