Skip to content

some static analysis warning at line 11317 #1390

@ipodipad

Description

@ipodipad
  • What is the issue you have?
Firstly, thanks for making this great easy json utility!
I'm not sure this is false positive or something, but I just report this warning.
May this be helpful~

at line 11317 in json.hpp
const bool is_negative = std::is_same<NumberType, number_integer_t>::value and not (x >= 0);  // see issue #755
static analysis tool says (codesonar),
Redundant Condition
x >= 0 always evaluates to true.
The condition is testing whether an unsigned value is nonnegative, but unsigned values are always nonnegative.
  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?

  • What is the expected behavior?

  • And what is the actual behavior instead?

  • Which compiler and operating system are you using? Is it a supported compiler?

arm-linux-gnueabihf-g++ (Linaro GCC 6.3-2017.05) 6.3.1 20170404
  • Did you use a released version of the library or the version from the develop branch?
version: 3.4.0 from develop branch 

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions