(DCL_TYPE (optype) != DCL_TYPE (type)) &&
!IS_GENPTR (type))
{
- werror (E_INCOMPAT_CAST);
+ werror (W_INCOMPAT_CAST);
fprintf (stderr, "from type '");
printTypeChain (optype, stderr);
fprintf (stderr, "' to type '");
/* left is integral type and right is literal then
check if the literal value is within bounds */
- if (IS_INTEGRAL (ltype) && IS_LITERAL (rtype))
+ if (IS_INTEGRAL (ltype) && IS_VALOP (right) && IS_LITERAL (rtype))
{
int nbits = bitsForType (ltype);
long v = (long) operandLitValue (right);
sym_link *type, *etype;
int stack = 0;
- if (!IS_FUNC(OP_SYMBOL(left)->type)) {
+ if (!IS_FUNC(OP_SYMBOL(left)->type) &&
+ !IS_CODEPTR(OP_SYMBOL(left)->type)) {
werror (E_FUNCTION_EXPECTED);
return NULL;
}
{
iCode *ic;
- ic = newiCode (ARRAYINIT, array, NULL);
- IC_ARRAYILIST (ic) = tree->values.constlist;
+ if (!getenv("TRY_THE_NEW_INITIALIZER")) {
+ ic = newiCode (ARRAYINIT, array, NULL);
+ IC_ARRAYILIST (ic) = tree->values.constlist;
+ } else {
+ operand *left=newOperand(), *right=newOperand();
+ left->type=right->type=SYMBOL;
+ OP_SYMBOL(left)=AST_SYMBOL(tree->left);
+ OP_SYMBOL(right)=AST_SYMBOL(tree->right);
+ ic = newiCode (ARRAYINIT, left, right);
+ }
ADDTOCHAIN (ic);
}