Closed aloisklink closed 1 year ago
Oh, well, since the parameter name is the same of the type, I'd just drop the first one. As in:
explicit uv_type(loop::token, std::shared_ptr<loop> ref) noexcept
Rather than:
explicit uv_type([[maybe_unused]] loop::token token, std::shared_ptr<loop> ref) noexcept
Oh, well, since the parameter name is the same of the type, I'd just drop the first one.
That makes sense! You only really need [[maybe_unused]]
if you need to give the parameter a name (e.g. for Doxygen). I've fixed this in https://github.com/skypjack/uvw/pull/296/commits/619bf5d9a0fa6cfa3174ef1ec879e2790b13c5a9, and I've updated the commit/PR description to remove any references to [[maybe_unused]]
.
Thank you (and sorry for the late reply, I'm out of home).
Thank you (and sorry for the late reply, I'm out of home).
No worries! 2 days isn't really a late reply! I might take a while to reply too, since although we're generally allowed to submit patches to open-source, we're only allowed to do it in our personal time!
The
uv_type()
constructor does not use itstoken
parameter, which causes a-Werror=unused
compiler error on GCC (and probably on other compilers too).~Luckily, C++17 adds the
[[maybe_unused]]
attribute that all standards compliant compilers will support to hide unused errors.~ Removed, see https://github.com/skypjack/uvw/pull/296#issuecomment-1686169140.This fixes the error reported in https://github.com/skypjack/uvw/issues/294#issuecomment-1683625763, but I didn't want to add a
Fixes: #294
into my commit or PR, since it seems like that issue is more about disabling all potential warnings using CMake, not just this single error.