From 29c05b900b0c0189d3a4e062fb8b9e18faf7f034 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Feb 2013 18:00:20 +0100 Subject: [PATCH] Mark BOOST_STATIC_ASSERT with 'CGAL_UNUSED' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to fix such a warning from g++-4.8: warning: typedef ‘boost_static_assert_typedef_241’ locally defined but not used [-Wunused-local-typedefs] then: - create one macro CGAL_UNUSED that is "__attribute__ ((__unused__))" with g++ or empty otherwise, - use it after BOOST_STATIC_ASSERT in the definition of CGAL_static_assertion. --- Installation/include/CGAL/config.h | 8 +++++++- STL_Extension/include/CGAL/assertions.h | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 2187fa954ac..464c2ad70c7 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -292,13 +292,19 @@ using std::max; #endif -// Macro to specify a noreturn attribute. +// Macro to specify a 'noreturn' attribute. #ifdef __GNUG__ # define CGAL_NORETURN __attribute__ ((__noreturn__)) #else # define CGAL_NORETURN #endif +// Macro to specify a 'unused' attribute. +#ifdef __GNUG__ +# define CGAL_UNUSED __attribute__ ((__unused__)) +#else +# define CGAL_UNUSED +#endif // If CGAL_HAS_THREADS is not defined, then CGAL code assumes // it can do any thread-unsafe things (like using static variables). diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 0470dfa2467..036b8e1eefd 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -115,18 +115,18 @@ inline bool possibly(Uncertain c); # if defined(CGAL_NO_ASSERTIONS) # define CGAL_static_assertion(EX) \ - BOOST_STATIC_ASSERT(true) + BOOST_STATIC_ASSERT(true) CGAL_UNUSED # define CGAL_static_assertion_msg(EX,MSG) \ - BOOST_STATIC_ASSERT(true) + BOOST_STATIC_ASSERT(true) CGAL_UNUSED # else // no CGAL_NO_ASSERTIONS # define CGAL_static_assertion(EX) \ - BOOST_STATIC_ASSERT(EX) + BOOST_STATIC_ASSERT(EX) CGAL_UNUSED # define CGAL_static_assertion_msg(EX,MSG) \ - BOOST_STATIC_ASSERT(EX) + BOOST_STATIC_ASSERT(EX) CGAL_UNUSED # endif // no CGAL_NO_ASSERTIONS