libgraphqlparser icon indicating copy to clipboard operation
libgraphqlparser copied to clipboard

Fix the `-Wunused-parameter` build-time warning.

Open ikmsk10 opened this issue 4 years ago • 3 comments

The methods of the AstVisitor base class defines interface only and have no implementation. These should be marked as [[maybe_unused]] to prevent propagate the build warnings.

Signed-off-by: Igor Kononenko [email protected]

ikmsk10 avatar Jun 26 '21 15:06 ikmsk10

CLA Signed

The committers are authorized under a signed CLA.

  • :white_check_mark: Igor Kononenko (c39e449e179e8fd5ba6951532b37814f726afdea)

[[maybe_unused]] was "only" added in C++17. https://en.cppreference.com/w/cpp/language/attributes/maybe_unused

While many of us are past that at this point, not all users are. Many of us don't see the warnings, possibly because of this line of code: https://github.com/graphql/libgraphqlparser/blob/master/CMakeLists.txt#L8

Is it possible that the warning only comes when not compiling with the repo's cmake files?

mmatsa avatar Oct 14 '21 16:10 mmatsa