Skip to content
Snippets Groups Projects
Commit b74f9790 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Remove deprecated DUNE_UNUSED

parent 8046a2d7
Branches
Tags
1 merge request!1076Remove deprecated code parts or properly deprecate parts that were meant for removal
......@@ -36,6 +36,11 @@
that it is no drop-in replacement, as it must be sometimes placed at
different position in the code.
- The macros `DUNE_UNUSED` is removed Use C++17's attribute
`[[maybe_unused]]` instead, but be aware that it is no drop-in
replacement, as it must be sometimes placed at a different position
in the code.
# Release 2.8
- Set minimal required CMake version in cmake to >= 3.13.
......
......@@ -10,9 +10,6 @@
# This module internally sets the following variables, which are then
# exported into the config.h of the current dune module.
#
# :code:`HAS_ATTRIBUTE_UNUSED`
# True if attribute unused is supported
#
# .. cmake_variable:: DISABLE_CXX_VERSION_CHECK
#
# You may set this variable to TRUE to disable checking for
......@@ -180,18 +177,6 @@ endif()
# make sure we have at least C++17
dune_require_cxx_standard(MODULE "DUNE" VERSION 17)
# perform tests
# __attribute__((unused))
check_cxx_source_compiles("
int main(void)
{
int __attribute__((unused)) foo;
return 0;
};
" HAS_ATTRIBUTE_UNUSED
)
# ******************************************************************************
#
# Checks for standard library features
......
......@@ -20,9 +20,6 @@
/* Standard debug streams with a level below will collapse to doing nothing */
#define DUNE_MINIMAL_DEBUG_LEVEL ${DUNE_MINIMAL_DEBUG_LEVEL}
/* does the compiler support __attribute__((unused))? */
#cmakedefine HAS_ATTRIBUTE_UNUSED 1
/* does the standard library provide experimental::make_array() ? */
#cmakedefine DUNE_HAVE_CXX_EXPERIMENTAL_MAKE_ARRAY 1
......@@ -97,6 +94,7 @@
/* old feature support macros which were tested until 2.8, kept around for one more release */
#define HAS_ATTRIBUTE_DEPRECATED 0
#define HAS_ATTRIBUTE_DEPRECATED_MSG 0
#define HAS_ATTRIBUTE_UNUSED 0
/* Define to ENABLE_UMFPACK if the UMFPack library is available */
#cmakedefine HAVE_UMFPACK ENABLE_SUITESPARSE
......
......@@ -4,27 +4,9 @@
#define DUNE_COMMON_UNUSED_HH
/** \file
* \brief Definition of the DUNE_UNUSED macro for the case that config.h
* is not available
* \brief Definition of the `DUNE_UNUSED_PARAMETER` macro.
*/
#ifndef HAS_ATTRIBUTE_UNUSED
//! A macro for marking variables that the compiler mistakenly flags as unused, which sometimes happens due to templates.
/**
* \ingroup CxxUtilities
* \deprecated Use C++17's \code[[maybe_unused]]\endcode instead. This
* macro will be removed after Dune 2.8. Be aware that it must be
* sometimes placed at a different position in the code.
*/
#define DUNE_UNUSED
#else
#ifdef __GNUC__
# define DUNE_UNUSED _Pragma("GCC warning \"DUNE_UNUSED is deprecated\"") __attribute__((unused))
#else
# define DUNE_UNUSED _Pragma("message \"DUNE_UNUSED is deprecated\"") __attribute__((unused))
#endif
#endif
/**
* A macro to mark intentionally unused function parameters with.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment