[Dune-devel] How to proceed with deprecation of DUNE_UNUSED_PARAM?

Christoph GrĂ¼ninger foss at grueninger.de
Wed Mar 24 23:03:43 CET 2021


Dear Dune developers,

I want to get rid of our own macros that suppress unused variable and
unused parameter warnings. C++17 provides the attribute [[maybe_unused]]
and it can be used for both of our DUNE_UNUSED and DUNE_UNUSED_PARAM in
a standard fashion without relying on compiler extensions or CMake checks.
But there is a catch: GCC < 9.3 has a bug that marking the first
argument of a constructor as maybe unused leads to a crash (bug 81429).
Within the core modules, UG grid, typetree, and functions this
constellation occurred only once.

How should I proceed?

1. Working around the bug as in dune-geometry / dune-geometry!158. I
would add this piece of information to the changelog. It would make the
deprecation of the whole header smooth.

2. Only deprecate DUNE_UNUSED and leave DUNE_UNUSED_PARAM as it is. In
this case we cannot have deprecation warnings (possible for headers, not
for macros).

We can get rid of the CMake checks after Dune 2.8 either way.

What do you think?

Discussion in the dune-common MR:
https://gitlab.dune-project.org/core/dune-common/-/merge_requests/946#note_79045

Bye
Christoph




More information about the Dune-devel mailing list