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

Clang 10.0 / GCC 10.1 warnings on disabled exceptions #2304

Closed
AODQ opened this issue Jul 23, 2020 · 0 comments · Fixed by #2305
Closed

Clang 10.0 / GCC 10.1 warnings on disabled exceptions #2304

AODQ opened this issue Jul 23, 2020 · 0 comments · Fixed by #2305
Assignees
Labels
confirmed kind: bug release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@AODQ
Copy link
Contributor

AODQ commented Jul 23, 2020

There are warnings on unused variables on both clang and GCC when exceptions are disabled, just pulled from latest commit ( 43e07bb ) on develop branch.

    template<class Exception>
    bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/,
                     const Exception& ex)
    {
        errored = true;
        if (allow_exceptions)
        {
            JSON_THROW(ex);
        }
        return false;
    }

GCC 10.1.0

third-party/json/single_include/nlohmann/json.hpp|5441 col 39| warning: unused parameter ‘ex’ [-Wunused-parameter]
||  5441 |                      const Exception& ex)
||       |                      ~~~~~~~~~~~~~~~~~^~

Clang 10.0

third-party/json/single_include/nlohmann/json.hpp:5441:39: warning: unused parameter 'ex' [-Wunused-parameter]
                     const Exception& ex)

Pretty sure this is because JSON_THROW is an empty macro so ex does nothing.

@AODQ AODQ added the kind: bug label Jul 23, 2020
@nlohmann nlohmann added confirmed solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Jul 24, 2020
@nlohmann nlohmann linked a pull request Jul 24, 2020 that will close this issue
@nlohmann nlohmann self-assigned this Jul 24, 2020
@nlohmann nlohmann added this to the Release 3.8.1 milestone Jul 24, 2020
nlohmann added a commit that referenced this issue Jul 25, 2020
fixes unused variable 'ex' for #2304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed 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.

2 participants