Skip to content

Negative integer values are not handled properly #18

@carneyweb

Description

@carneyweb

If I have some json that looks something like:

{
"foo" : -1
}

The value of -1 gets saved in the compilable output as the 2's complement unsigned value.

The problem is at line 76 in json2cpp.cpp:

return fmt::format("std::int64_t{{{}}}", value.get<std::**uint64_t**>());

Change that to std::int64_t and everything works great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions