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

unused-parameter on OSX when Diagnostics is off #2658

Closed
4 tasks
bflorac opened this issue Mar 1, 2021 · 3 comments · Fixed by #2561
Closed
4 tasks

unused-parameter on OSX when Diagnostics is off #2658

bflorac opened this issue Mar 1, 2021 · 3 comments · Fixed by #2561
Assignees
Labels
kind: bug release item: 🔨 further change solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@bflorac
Copy link

bflorac commented Mar 1, 2021

What is the issue you have?

When compiling on OSX (CLANG) the default compiler state has unused-parameter turn on. This issues warnings for json.hpp, class exception, function diagnostics(), because the leaf_element parameter is not used. A simple (void)(leaf_element) in the #ELSE clause will resolve the issue.

Please describe the steps to reproduce the issue.

Can you provide a small but working code example?

What is the expected behavior?

And what is the actual behavior instead?

Which compiler and operating system are you using?

  • Compiler: CLANG
  • Operating system: OSX

Which version of the library did you use?

  • [x ] latest release version 3.9.1
  • other release - please state the version: ___
  • the develop branch

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below
@gregmarr
Copy link
Contributor

gregmarr commented Mar 1, 2021

Same as #2646
@nlohmann This should be a simple fix.

@eike-fokken
Copy link

If you are ok with using standard specific macros, you could also use
the [[maybe_unused]] specifier for c++17 and later.
It has the (albeit small) advantage that nothing unneccessary is done at runtime even when all optimization is turned off.

@nlohmann
Copy link
Owner

Duplicate of #2646.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Mar 23, 2021
@nlohmann nlohmann linked a pull request Mar 23, 2021 that will close this issue
@nlohmann nlohmann self-assigned this Mar 24, 2021
@nlohmann nlohmann added release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Mar 24, 2021
@nlohmann nlohmann added this to the Release 3.9.2 milestone Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug release item: 🔨 further change solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants