Skip to content

Commit

Permalink
Fix -Wno-sometimes-uninitialized by initializing "result" in parse_sax
Browse files Browse the repository at this point in the history
The function parse_sax() returns sometimes-uninitialized warnings in
some compilers. This commit fixes that.
  • Loading branch information
Tsz-Ho Yu committed Aug 18, 2018
1 parent e33b31e commit 3004a73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/nlohmann/detail/input/binary_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class binary_reader
const bool strict = true)
{
sax = sax_;
bool result;
bool result = false;

switch (format)
{
Expand Down
2 changes: 1 addition & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6033,7 +6033,7 @@ class binary_reader
const bool strict = true)
{
sax = sax_;
bool result;
bool result = false;

switch (format)
{
Expand Down

0 comments on commit 3004a73

Please sign in to comment.