Skip to content

Commit

Permalink
uv_type: supress -Werror=unused compiler errors
Browse files Browse the repository at this point in the history
The `uv_type()` constructor does not use its `token` parameter,
which causes a `-Werror=unused` compiler error on GCC (and probably
on other compilers too).

Luckily, C++17 adds the [`[[maybe_unused]]`][1] attribute that all
standards compliant compilers will support to hide unused errors.

[1]: https://en.cppreference.com/w/cpp/language/attributes/maybe_unused

on-behalf-of: @nqminds <[email protected]>
  • Loading branch information
aloisklink authored Aug 21, 2023
1 parent d88bfca commit 003ee28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uvw/uv_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace uvw {
*/
template<typename U>
struct uv_type {
explicit uv_type(loop::token token, std::shared_ptr<loop> ref) noexcept
explicit uv_type([[maybe_unused]] loop::token token, std::shared_ptr<loop> ref) noexcept
: owner{std::move(ref)}, resource{} {}

uv_type(const uv_type &) = delete;
Expand Down

0 comments on commit 003ee28

Please sign in to comment.