8000 clang++ 6.0 (Xcode 9.3) Error in CEREAL_RAPIDJSON_ASSERT macro · Issue #439 · USCiLab/cereal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
clang++ 6.0 (Xcode 9.3) Error in CEREAL_RAPIDJSON_ASSERT macro #439
Open
@puentev

Description

@puentev

From current stable version i'm getting this warning (with -Wall):

../ext/cereal//include/cereal/external/rapidjson/document.h:597:9: error: 'GenericValue' has a non-throwing exception specification but can still throw [-Werror,-Wexceptions]
CEREAL_RAPIDJSON_ASSERT(type <= kNumberType);

With latest Xcode (9.3) this is no longer a warning but an error. As dirty workaround ...
replace in
cereal/include/cereal/archives/json.hpp

#define CEREAL_RAPIDJSON_ASSERT(x) if(!(x)){ 
throw ::cereal::RapidJSONException("rapidjson internal assertion failure: " #x); }

by

#ifndef CEREAL_RAPIDJSON_ASSERT
#ifdef __APPLE__
#define CEREAL_RAPIDJSON_ASSERT(x) if(!(x)){ assert(0 && "fallo json");};
#else
#define CEREAL_RAPIDJSON_ASSERT(x) if(!(x)){ \
throw ::cereal::RapidJSONException("rapidjson internal assertion failure: " #x); }
#endif
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0