Open lifflander opened 5 years ago
The warnings generated by these are not fixed in #306 because [[maybe_unused]] disables the warnings under gcc but creates additional warnings under clang.
I tested using constexpr instead of static. While it fixes the issue on gcc it doesn't on clang.
However, clang and icc seem to accept __attribute__((unused))
which is a gcc extension. This seems to work with --pedantic. Are there any restrictions on using gcc extensions?
I'm not sure about any restrictions. @bathmatt?
For now, in the branch for #306, I just wrapped these instances (and other static structs) in the following:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
...
#pragma GCC diagnostic pop
We will still need to refactor the code in the future.
After we do this, we should be able to remove all the gcc unused-variable warnings.