0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-27 13:33:17 +08:00

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.
This commit is contained in:
Arseny Kapoulkine 2017-03-21 21:57:16 -07:00
parent acfe47ba52
commit 956be4ca4b

View File

@ -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--;
}