X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCast.c;h=a2066a19fdd4a6cc70197b1f7f4cb142e207820a;hb=3096c622c84deebb7d4147ff68f01f80cfe567d8;hp=0024cff3f35408cb2de43418cc6be5cf6a4f5a81;hpb=4d406d0af5861a351d089724c5f3e6d1ee8f70d4;p=fw%2Fsdcc diff --git a/src/SDCCast.c b/src/SDCCast.c index 0024cff3..a2066a19 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -2144,7 +2144,7 @@ decorateType (ast * tree) { sym_link *ltc = (tree->right ? RTYPE (tree) : LTYPE (tree)); COPYTYPE (TTYPE (tree), TETYPE (tree), ltc); - if (!tree->initMode && IS_CONSTANT (TTYPE (tree))) + if (!tree->initMode && IS_CONSTANT(TETYPE(tree))) werror (E_CODE_WRITE, tree->opval.op==INC_OP ? "++" : "--"); if (tree->right) @@ -3124,7 +3124,7 @@ decorateType (ast * tree) RRVAL (tree) = 1; TETYPE (tree) = getSpec (TTYPE (tree) = LTYPE (tree)); - if (!tree->initMode && IS_CONSTANT (LTYPE (tree))) + if (!tree->initMode && IS_CONSTANT (LETYPE (tree))) werror (E_CODE_WRITE, "&= or |= or ^= or >>= or <<="); if (LRVAL (tree)) @@ -3159,7 +3159,7 @@ decorateType (ast * tree) computeType (LTYPE (tree), RTYPE (tree))); - if (!tree->initMode && IS_CONSTANT (LTYPE (tree))) + if (!tree->initMode && IS_CONSTANT (LETYPE (tree))) werror (E_CODE_WRITE, "-="); if (LRVAL (tree)) @@ -3200,7 +3200,7 @@ decorateType (ast * tree) computeType (LTYPE (tree), RTYPE (tree))); - if (!tree->initMode && IS_CONSTANT (LTYPE (tree))) + if (!tree->initMode && IS_CONSTANT (LETYPE (tree))) werror (E_CODE_WRITE, "+="); if (LRVAL (tree)) @@ -3248,7 +3248,7 @@ decorateType (ast * tree) RRVAL (tree) = 1; LLVAL (tree) = 1; if (!tree->initMode ) { - if (IS_CONSTANT (LTYPE (tree))) + if ((IS_SPEC(LETYPE(tree)) && IS_CONSTANT (LETYPE (tree)))) werror (E_CODE_WRITE, "="); } if (LRVAL (tree))