From bcab9cf8f2fdd6b61344c88ca511849f75a6be9e Mon Sep 17 00:00:00 2001 From: Gabor Szalai <gabor.szalai@ericsson.com> Date: Fri, 14 Aug 2020 17:04:57 +0200 Subject: [PATCH] Remove leading zero warning from str2float compiler part (bug 566028) The standard explicitly allow the leading zero for str2float Leading zero warning is not needed as it is allowed. C.1.29 Character string to float str2float(in charstring invalue) return float This function converts a charstring comprising a number into a float value. The format of the number in the charstring shall follow rules in clause 6.1.0, items a) or b) with the following exceptions: leading zeros are allowed; EXAMPLE: str2float("12345.6") // is the same as str2float("123.456E+02") Change-Id: I0e29260f893874d4b34372cd064882bb51087260 Signed-off-by: Gabor Szalai <gabor.szalai@ericsson.com> --- compiler2/Value.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler2/Value.cc b/compiler2/Value.cc index 2302b68d4..f4d08677f 100644 --- a/compiler2/Value.cc +++ b/compiler2/Value.cc @@ -6003,8 +6003,6 @@ void Value::chk_expr_operand_execute_refd(Value *v1, if (c == '.') state = S_FIRST_F; else if (c == 'E' || c == 'e') state = S_INITIAL_E; else if (c >= '0' && c <= '9') { - val->warning("Leading zero digit was detected and ignored in the " - "mantissa of the operand of operation `%s'", opname); state = S_MORE_M; } else state = S_ERR; break; @@ -6036,8 +6034,6 @@ void Value::chk_expr_operand_execute_refd(Value *v1, break; case S_ZERO_E: if (c >= '0' && c <= '9') { - val->warning("Leading zero digit was detected and ignored in the " - "exponent of the operand of operation `%s'", opname); state = S_MORE_E; } else state = S_ERR; -- GitLab