git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1992
4a8a32a2-be11-0410-ad9d-
d568d2c75423
// $1 must be a pointer to a function
sym_link *p=newLink();
DCL_TYPE(p) = FUNCTION;
// $1 must be a pointer to a function
sym_link *p=newLink();
DCL_TYPE(p) = FUNCTION;
+ if (!$1) {
+ // ((void (code *) ()) 0) ()
+ $1=newLink();
+ DCL_TYPE($1)=CPOINTER;
+ $$ = $1;
+ }
$1->next=p;
}
| abstract_declarator2 '(' parameter_type_list ')' {
$1->next=p;
}
| abstract_declarator2 '(' parameter_type_list ')' {
- werror(E_INTERNAL_ERROR,"typeFromStr");
+ werror(E_INTERNAL_ERROR, __FILE__, __LINE__,
+ "typeFromStr: unknown type");
break;
}
if (IS_SPEC(r) && usign) {
break;
}
if (IS_SPEC(r) && usign) {
case GPOINTER:
genGenPointerSet (right, result, ic, pi);
break;
case GPOINTER:
genGenPointerSet (right, result, ic, pi);
break;
+
+ default:
+ werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
+ "genPointerSet: illegal pointer type");
}
/*-----------------------------------------------------------------*/
}
/*-----------------------------------------------------------------*/
-/* emitcodePointerGet - gget value from code space */
+/* genCodePointerGet - get value from code space */
/*-----------------------------------------------------------------*/
static void
/*-----------------------------------------------------------------*/
static void
-emitcodePointerGet (operand * left,
+genCodePointerGet (operand * left,
operand * result, iCode * ic, iCode *pi)
{
int size, offset, dopi=1;
operand * result, iCode * ic, iCode *pi)
{
int size, offset, dopi=1;
- emitcodePointerGet (left, result, ic, pi);
+ genCodePointerGet (left, result, ic, pi);
case GPOINTER:
genGenPointerSet (right, result, ic, pi);
break;
case GPOINTER:
genGenPointerSet (right, result, ic, pi);
break;
+
+ default:
+ werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
+ "genPointerSet: illegal pointer type");
case GPOINTER:
genGenPointerSet (right, result, ic, pi);
break;
case GPOINTER:
genGenPointerSet (right, result, ic, pi);
break;
+
+ default:
+ werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
+ "genPointerSet: illegal pointer type");
}
/*-----------------------------------------------------------------*/
}
/*-----------------------------------------------------------------*/
-/* pic14_emitcodePointerGet - gget value from code space */
+/* genCodePointerGet - get value from code space */
/*-----------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
-static void pic14_emitcodePointerGet (operand *left,
+static void genCodePointerGet (operand *left,
operand *result, iCode *ic)
{
int size, offset ;
operand *result, iCode *ic)
{
int size, offset ;
- pic14_emitcodePointerGet (left,result,ic);
+ genCodePointerGet (left,result,ic);
case GPOINTER:
genGenPointerSet (right,result,ic);
break;
case GPOINTER:
genGenPointerSet (right,result,ic);
break;
+ default:
+ werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
+ "genPointerSet: illegal pointer type");
+ }
}
/*-----------------------------------------------------------------*/
}
/*-----------------------------------------------------------------*/