Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused variable warning #304

Closed
jonnymwalker opened this issue Sep 6, 2016 · 1 comment
Closed

Unused variable warning #304

jonnymwalker opened this issue Sep 6, 2016 · 1 comment
Assignees
Milestone

Comments

@jonnymwalker
Copy link

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!

@nlohmann
Copy link
Owner

For reference, the warning is

src/json.hpp:10119:33: warning: unused variable 'x' [-Wunused-variable]
                     basic_json& x = result.at(top_pointer);
                                 ^

@nlohmann nlohmann self-assigned this Sep 11, 2016
@nlohmann nlohmann added this to the Release 2.0.4 milestone Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants