I have this minimal json schema:
{
"type": "object",
"additionalProperties": false
}
which render as following code:
// ...
struct Nop {};
inline void from_json(const json & j, Nop& x) {}
inline void to_json(json & j, const Nop & x) {
j = json::object();
}
The compiler raise warning about j or x are not used. And since I use the -Werror option, it turns into an error.
I can use #pragma GCC diagnostic … to change compiler warning behavior, but it is not satisfying and not portable. It will be better if the generated code does not create any warning.
I have this minimal json schema:
{ "type": "object", "additionalProperties": false }which render as following code:
The compiler raise warning about
jorxare not used. And since I use the-Werroroption, it turns into an error.I can use
#pragma GCC diagnostic …to change compiler warning behavior, but it is not satisfying and not portable. It will be better if the generated code does not create any warning.