Skip to content

Unused variable warning #304

Closed
Closed

Description

@jonnymwalker

Hi, I get an unused variable warning when compiling this program (test.cpp):

#include "json.hpp"

using json = nlohmann::json;

int main()
{
  json object;
  json patch = json::array();
  object = object.patch(patch);
  return 0;
}  

Compile command is:
g++ -Wall -std=c++11 test.cpp json.hpp

Compiler version:
g++ (Debian 6.1.1-11) 6.1.1 20160802

Thanks for the amazing library!

Activity

  1. nlohmann commented on Sep 11, 2016

    @nlohmann
    Owner

    For reference, the warning is

    src/json.hpp:10119:33: warning: unused variable 'x' [-Wunused-variable]
                         basic_json& x = result.at(top_pointer);
                                     ^
    
  2. self-assigned this
    on Sep 11, 2016
  3. added this to the Release 2.0.4 milestone on Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions