From ddad6e7b6fbf3ff00aa9af4b3d0ccd58ceaf7470 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 19 Aug 2021 11:24:25 +0200 Subject: [PATCH] backward compatible incomplete ? CALC expression --- modules/libcom/src/calc/postfix.c | 2 ++ modules/libcom/test/epicsCalcTest.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/libcom/src/calc/postfix.c b/modules/libcom/src/calc/postfix.c index 1a46bddf2..f2a16e572 100644 --- a/modules/libcom/src/calc/postfix.c +++ b/modules/libcom/src/calc/postfix.c @@ -428,10 +428,12 @@ LIBCOM_API long pstacktop--; } +/* if (cond_count != 0) { *perror = CALC_ERR_CONDITIONAL; goto bad; } +*/ if (runtime_depth > 1) { *perror = CALC_ERR_TOOMANY; goto bad; diff --git a/modules/libcom/test/epicsCalcTest.cpp b/modules/libcom/test/epicsCalcTest.cpp index cf4cf9b62..d51f9a031 100644 --- a/modules/libcom/test/epicsCalcTest.cpp +++ b/modules/libcom/test/epicsCalcTest.cpp @@ -298,7 +298,7 @@ MAIN(epicsCalcTest) const double a=1.0, b=2.0, c=3.0, d=4.0, e=5.0, f=6.0, g=7.0, h=8.0, i=9.0, j=10.0, k=11.0, l=12.0; - testPlan(630); + testPlan(/*630*/628); /* LITERAL_OPERAND elements */ testExpr(0); @@ -945,8 +945,8 @@ MAIN(epicsCalcTest) testBadExpr("MAX()", CALC_ERR_SYNTAX); testBadExpr("MAX(A,)", CALC_ERR_SYNTAX); testBadExpr("MAX(A,B,)", CALC_ERR_SYNTAX); - testBadExpr("1?", CALC_ERR_CONDITIONAL); - testBadExpr("1?1", CALC_ERR_CONDITIONAL); +// testBadExpr("1?", CALC_ERR_CONDITIONAL); +// testBadExpr("1?1", CALC_ERR_CONDITIONAL); testBadExpr(":1", CALC_ERR_SYNTAX); // Bit manipulations wrt bit 31 (bug lp:1514520)