From 3eb147071334a7900fb91b3346a81963aa4f1d5b Mon Sep 17 00:00:00 2001 From: zimoch Date: Fri, 9 Dec 2011 17:32:55 +0000 Subject: [PATCH] compatibility with older versions: allow ? operator with missing : --- src/libCom/calc/postfix.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/libCom/calc/postfix.c b/src/libCom/calc/postfix.c index 1f1a60789..04404fe51 100644 --- a/src/libCom/calc/postfix.c +++ b/src/libCom/calc/postfix.c @@ -376,6 +376,7 @@ epicsShareFunc long /* For : operator, also push COND_END code to stack */ if (pel->name[0] == ':') { if (--cond_count < 0) { + fprintf(stderr, "postfix: ':' without '?'\n"); *perror = CALC_ERR_CONDITIONAL; goto bad; } @@ -405,10 +406,13 @@ epicsShareFunc long pstacktop--; } - if (cond_count != 0) { - *perror = CALC_ERR_CONDITIONAL; - goto bad; - } +/* + * if (cond_count != 0) { + * fprintf(stderr, "postfix: unbalanced '?:' at ';'\n"); + * *perror = CALC_ERR_CONDITIONAL; + * goto bad; + * } + */ if (runtime_depth > 1) { *perror = CALC_ERR_TOOMANY; goto bad; @@ -452,10 +456,13 @@ epicsShareFunc long } *pout = END_EXPRESSION; - if (cond_count != 0) { - *perror = CALC_ERR_CONDITIONAL; - goto bad; - } +/* + * if (cond_count != 0) { + * fprintf(stderr, "postfix: unbalanced '?:' at end of CALC\n"); + * *perror = CALC_ERR_CONDITIONAL; + * goto bad; + * } + */ if (operand_needed || runtime_depth != 1) { *perror = CALC_ERR_INCOMPLETE; goto bad;