diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-03-21 21:57:16 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2017-03-21 21:57:16 -0700 |
commit | 956be4ca4bed18560b75aea52973da89f9723d46 (patch) | |
tree | abef783052d774969cfba2c1b9366127ca3d9280 | |
parent | acfe47ba52c6fca355b87d15a462a2e09807f5fe (diff) |
Revert "Fix gcc-4.8 compilation warning when using -Wstrict-overflow"
This reverts commit 79109a8546f963d17522d75112cffcfd8cbe35fc.
This warning does not happen on gcc-4.8.4; the workaround introduces an
unsigned integer overflow which results in a runtime error when compiled
with integer sanitizer.
-rw-r--r-- | src/pugixml.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index cb8e862..e4c04eb 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -2451,7 +2451,7 @@ PUGI__NS_BEGIN for (;;) { - if (static_cast<unsigned int>(static_cast<unsigned int>(ch) - '0') <= 9) + if (static_cast<unsigned int>(ch - '0') <= 9) ucsc = 10 * ucsc + (ch - '0'); else if (ch == ';') break; @@ -8047,7 +8047,7 @@ PUGI__NS_BEGIN { while (exponent > 0) { - assert(*mantissa == 0 || static_cast<unsigned int>(static_cast<unsigned int>(*mantissa) - '0') <= 9); + assert(*mantissa == 0 || static_cast<unsigned int>(*mantissa - '0') <= 9); *s++ = *mantissa ? *mantissa++ : '0'; exponent--; } |