fixed bug #476632
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 31 Oct 2001 10:14:13 +0000 (10:14 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 31 Oct 2001 10:14:13 +0000 (10:14 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1477 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c
src/SDCCsymt.c

index 4f52b34099b47822ab4cd111b535b416b9c9d23c..41eb8313f58c4ac09e6492e85db1af8a8b15d579 100644 (file)
@@ -734,7 +734,7 @@ processParms (ast * func,
        * Therefore, if there are more defined parameters, the caller didn't
        * supply enough.
        */
-      if (0 && rightmost && defParm->next)
+      if (rightmost && defParm->next)
        {
          werror (E_TOO_FEW_PARMS);
          return 1;
index da4212bdea72bf48a541477be117b55b9c8d979e..be8444e8cfef6957cd3e854f31d718e69a685f2c 100644 (file)
@@ -1764,23 +1764,29 @@ processFuncArgs (symbol * func, int ignoreName)
 {
   value *val;
   int pNum = 1;
+  sym_link *funcType=func->type;
+
+  // if this is a pointer to a function
+  if (DCL_TYPE(funcType)==CPOINTER) {
+    funcType=funcType->next;
+  }
 
   /* if this function has variable argument list */
   /* then make the function a reentrant one    */
-  if (IFFUNC_HASVARARGS(func->type))
-    FUNC_ISREENT(func->type)=1;
+  if (IFFUNC_HASVARARGS(funcType))
+    FUNC_ISREENT(funcType)=1;
 
   /* check if this function is defined as calleeSaves
      then mark it as such */
-  FUNC_CALLEESAVES(func->type) = inCalleeSaveList (func->name);
+  FUNC_CALLEESAVES(funcType) = inCalleeSaveList (func->name);
 
   /* loop thru all the arguments   */
-  val = FUNC_ARGS(func->type);
+  val = FUNC_ARGS(funcType);
 
   /* if it is void then remove parameters */
   if (val && IS_VOID (val->type))
     {
-      FUNC_ARGS(func->type) = NULL;
+      FUNC_ARGS(funcType) = NULL;
       return;
     }
 
@@ -1793,7 +1799,7 @@ processFuncArgs (symbol * func, int ignoreName)
       /* mark it as a register parameter if
          the function does not have VA_ARG
          and as port dictates */
-      if (!IFFUNC_HASVARARGS(func->type) &&
+      if (!IFFUNC_HASVARARGS(funcType) &&
          (*port->reg_parm) (val->type))
        {
          SPEC_REGPARM (val->etype) = 1;
@@ -1811,17 +1817,17 @@ processFuncArgs (symbol * func, int ignoreName)
   if (func->cdef) {
     /* ignore --stack-auto for this one, we don't know how it is compiled */
     /* simply trust on --int-long-reent or --float-reent */
-    if (IFFUNC_ISREENT(func->type)) {
+    if (IFFUNC_ISREENT(funcType)) {
       return;
     }
   } else {
     /* if this function is reentrant or */
     /* automatics r 2b stacked then nothing */
-    if (IFFUNC_ISREENT (func->type) || options.stackAuto)
+    if (IFFUNC_ISREENT (funcType) || options.stackAuto)
       return;
   }
 
-  val = FUNC_ARGS(func->type);
+  val = FUNC_ARGS(funcType);
   pNum = 1;
   while (val)
     {