-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc 7 and 8.2 warning: parameter ‘arg_name’ set but not used #2170
Comments
I was unable to reproduce it on Compiler Explorer with the corresponding warning option: https://godbolt.org/z/Gr65Tb. Lines 556 to 566 in 6a9016e
exactly as it's done here: Lines 478 to 479 in 6a9016e
@phprus, could you please check if this solution works for you? |
Хм...
and
This flag-set already generate a warning (fmt version: 6a9016e):
@alexezeder Yes, adding |
I was able to reproduce it with GCC 7.3. For this version it's even enough to add constexpr static bool try_format_argument(
OutputIt& out, [[maybe_unused]] basic_string_view<Char> arg_name,
const T& arg) { For me, it's a compiler bug because Also, I'm not sure which solution is clearer, the one with all arguments marked as maybe unused or the above one. |
I think it's better to only annotate the argument gcc complains about with a brief comment saying that it's a workaround for gcc 7. |
Warning:
The text was updated successfully, but these errors were encountered: