From: johanknol Date: Sat, 8 Sep 2001 09:58:45 +0000 (+0000) Subject: a CPOINTER can be used as a function X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ae6ade32154c090952ca4469a8ea582f180409b5;p=fw%2Fsdcc a CPOINTER can be used as a function git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1241 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 7ffaac40..cc43b873 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-09-08 + + * src/SDCCicode.c (geniCodeCall): a CPOINTER can be used as a function + 2001-09-07 * src/SDCCicode.c (newiCodeCondition): fixed bug #456235 (1.77) diff --git a/src/SDCCicode.c b/src/SDCCicode.c index c5bc3f15..393a6b20 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2665,7 +2665,8 @@ geniCodeCall (operand * left, ast * parms,int lvl) 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; } diff --git a/src/SDCCsymt.h b/src/SDCCsymt.h index fab6ac5c..02206c00 100644 --- a/src/SDCCsymt.h +++ b/src/SDCCsymt.h @@ -329,6 +329,7 @@ symbol; DCL_TYPE(x) == UPOINTER )) #define IS_PTR_CONST(x) (IS_PTR(x) && DCL_PTR_CONST(x)) #define IS_FARPTR(x) (IS_DECL(x) && DCL_TYPE(x) == FPOINTER) +#define IS_CODEPTR(x) (IS_DECL(x) && DCL_TYPE(x) == CPOINTER) #define IS_GENPTR(x) (IS_DECL(x) && DCL_TYPE(x) == GPOINTER) #define IS_FUNC(x) (IS_DECL(x) && DCL_TYPE(x) == FUNCTION) #define IS_LONG(x) (IS_SPEC(x) && x->select.s._long)