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 variable in exception class when not using improved diagnostics #2646

Closed
2 of 5 tasks
vpollex opened this issue Feb 15, 2021 · 1 comment · Fixed by #2561
Closed
2 of 5 tasks

Unused variable in exception class when not using improved diagnostics #2646

vpollex opened this issue Feb 15, 2021 · 1 comment · Fixed by #2561
Assignees
Labels
kind: bug release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@vpollex
Copy link

vpollex commented Feb 15, 2021

What is the issue you have?

At include/nlohmann/detail/exceptions.hpp:71 or single_include/nlohmann/json.hpp:2662 the parameter leaf_element is unused when the macro JSON_DIAGNOSTICS is undefined. This may cause a compiler to produce a warning or an error.

Please describe the steps to reproduce the issue.

  1. Compile code example below with warnings for unused parameters enabled, e.g. g++ -Wunused-parameter <filename>.

Can you provide a small but working code example?

#include <nlohmann/json.hpp>

int main() {
    return 0;
}

What is the expected behavior?

Compiler does not produce a warning.

And what is the actual behavior instead?

Compiler produces a warning.

Which compiler and operating system are you using?

  • Compiler: g++ 8.3.0 / g++ 10.2.0
  • Operating system: Linux

Which version of the library did you use?

  • 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
@Ric3cir121
Copy link

Ric3cir121 commented Mar 1, 2021 via email

@nlohmann nlohmann linked a pull request Mar 23, 2021 that will close this issue
@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 self-assigned this 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: 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.

3 participants