From: johanknol Date: Fri, 1 Mar 2002 10:31:52 +0000 (+0000) Subject: fixed bug #524209 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7c0f63b9c6907ac31c81ae7036481519f7e63ff6;p=fw%2Fsdcc fixed bug #524209 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1961 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index e96afef1..b6f7cbfb 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -2150,8 +2150,6 @@ decorateType (ast * tree) { // this ought to be ignored return (tree->left); - //werror (E_ILLEGAL_ADDR, "address of function"); - //goto errorTreeReturn; } if (IS_LITERAL(LTYPE(tree))) @@ -2736,12 +2734,16 @@ decorateType (ast * tree) LRVAL (tree) = 1; } #else +#if 0 // this is already checked, now this could be explicit /* if pointer to struct then check names */ if (IS_PTR(LTYPE(tree)) && IS_STRUCT(LTYPE(tree)->next) && IS_PTR(RTYPE(tree)) && IS_STRUCT(RTYPE(tree)->next) && - strcmp(SPEC_STRUCT(LETYPE(tree))->tag,SPEC_STRUCT(RETYPE(tree))->tag)) { - werror(W_CAST_STRUCT_PTR,SPEC_STRUCT(RETYPE(tree))->tag,SPEC_STRUCT(LETYPE(tree))->tag); - } + strcmp(SPEC_STRUCT(LETYPE(tree))->tag,SPEC_STRUCT(RETYPE(tree))->tag)) + { + werror(W_CAST_STRUCT_PTR,SPEC_STRUCT(RETYPE(tree))->tag, + SPEC_STRUCT(LETYPE(tree))->tag); + } +#endif /* if the right is a literal replace the tree */ if (IS_LITERAL (RETYPE (tree)) && !IS_PTR (LTYPE (tree))) { tree->type = EX_VALUE;