Skip to content
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

suppress unused variable warnings #2381

Merged
merged 3 commits into from
Jun 30, 2021
Merged

suppress unused variable warnings #2381

merged 3 commits into from
Jun 30, 2021

Conversation

gsjaardema
Copy link
Contributor

An arguably better method for suppressing unused variable warnings. The (void)var method does not work on many intel compiilers.
This is from Herb Sutter's blog post https://herbsutter.com/2009/10/18/mailbag-shutting-up-compiler-warnings/

An arguably better method for suppressing unused variable warnings.   The `(void)var` method does not work on many intel compiilers.
This is from Herb Sutter's blog post https://herbsutter.com/2009/10/18/mailbag-shutting-up-compiler-warnings/
@vitaut
Copy link
Contributor

vitaut commented Jun 26, 2021

Thanks for the PR but do you actually get a warning or is it mostly theoretical?

@gsjaardema
Copy link
Contributor Author

I actually get warnings on my Intel builds.

include/fmt/core.h Outdated Show resolved Hide resolved
@gsjaardema gsjaardema requested a review from vitaut June 28, 2021 17:16
// `(void)var` method does not work on many intel compilers. This is
// from Herb Sutter, "Shutting up compiler warnings",
// https://herbsutter.com/2009/10/18/mailbag-shutting-up-compiler-warnings/
template<class T> void ignore_unused( const T& ) { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you apply clang-format?

@vitaut vitaut merged commit fbb70ee into fmtlib:master Jun 30, 2021
@vitaut
Copy link
Contributor

vitaut commented Jun 30, 2021

Thank you

@gsjaardema gsjaardema deleted the patch-1 branch June 30, 2021 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants