sorry to my english
pass@i.com.ua
sdcc 2.3.0
if you try to compile this fragment
char test[(10>5)?10:5];
you'll get
error *** Constant Expected Found Variable
Segmentation fault.
patch:
file SDCCast.c
function constExprValue:
if (IS_AST_VALUE (cexpr))
return cexpr->opval.val;
+ if (IS_TERNARY_OP(cexpr) && IS_COLON_OP(cexpr-
>right)){
+ if(((int)floatFromVal(cexpr->left->opval.val)))
+ return constExprValue(cexpr->right-
>left,TRUE);
+ else
+ return constExprValue(cexpr->right-
>right,TRUE);
+ }
if (check){
werror (E_CONST_EXPECTED, "found
expression");
}
Logged In: YES
user_id=603650
Download latest version at:
http://sdcc.sourceforge.net/snap.php
http://sdcc.sourceforge.net/sdcctarbin.html
Logged In: YES
user_id=603650
This can't be reproduced in 2.3.2. Can you confirm it still
exists?