Skip to content

Clang 10.0 / GCC 10.1 warnings on disabled exceptions #2304

Description

@AODQ

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions