Skip to content

The result of json is_number_integer() function is wrong when read a json file  #2653

Description

@Ymxia1993

code:

#include <fstream>
#include <iostream>
#include "nlohmann/json.hpp"
using nlohmann::json;
int main()
{
  std::ifstream file("Test.json");
  json j = json::parse(file);
  std::cout<<j["a"].is_number_integer()<<std::endl;
}

json file:
{ "a":1 }
when use icc compiler(icc (ICC) 19.1.0.139 20191004) compile code, the result of json is_number_integer() function is 0, its obviously a wrong result.
However, when I use gcc compiler the result is right.

Platform :Linux version 3.10.0-1062.1.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) )

Activity

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

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