Avoid unhelpful -Wunused-variable

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 30 September 2015 06:06 UTC

...at least from "g++ (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)" with--disable-debug, when a namespace-scope const variable with a "complex" initializer declared in an include file remains unused.

Avoid that warning via SAL_CONSTEXPR, which in turn requires large parts of o3tl::is_typed_flags to be SAL_CONSTEXPR, which in turn requires a new HAVE_CXX14_CONSTEXPR to allow assert in constexpr functions, which in turn requires using -std=c++14 instead of -std=c++11 where available, which in turn (a) requires to /not/ use -std=c++14 if it would run into a bug between Clang and libstdc++ discussed at "llvm-nm fails to build with gcc 5.1's libstdc++" (and which hits us in sfx2/source/control/thumbnailview.cxx), and (b) requires a new HAVE_CXX14_SIZED_DEALLOCATION to work around GCC 5.1 -Werror=sized-deallocation (where Clang >= 3.7 only supports C++14 sized deallocation when explictly enabled via -fsized-deallocation, btw).

This effectively reverts ff6462e6307e6924dc6c8178043ae9032f4b4152 "avoid unused
variable warning:" again.

Change-Id: I424e3561452a3e6d8c8a9604d6c737cab49840c4 Reviewed-on: https://gerrit.libreoffice.org/18918

e261881 Avoid unhelpful -Wunused-variable
config_host/config_global.h.in | 2 +
configure.ac | 56 +++++++++++++++++++++++++--
include/o3tl/typed_flags_set.hxx | 73 ++++++++++++++++++++++++++----------
include/svx/dlgutil.hxx | 4 +-
sal/cpprt/operators_new_delete.cxx | 31 +++++++++++++++
5 files changed, 141 insertions(+), 25 deletions(-)

Upstream: cgit.freedesktop.org


  • Share