Prof A Olowofoyeku wrote:
Which gives a warning under GPC - and I am not sure what the warning means. The declaration:
TYPE TDllFunc = FUNCTION : Pointer attribute(stdcall);
gives this warning: "warning: `stdcall' attribute only applies to function types"
I thought I was applying the attribute to a function type? So what's with the warning?
Internally there is no variables of function type. Pascal function type is really a "reference" and was not recgnized by attribute handling code. The attribute was ignored, so the call would go wrong. The following should fix the problem:
--- p/declarations.c.bb 2005-03-08 03:21:43.209468768 +0100 +++ p/declarations.c 2005-03-08 03:21:49.310541264 +0100 @@ -2089,7 +2089,10 @@ } else tt = &TREE_CHAIN (*tt); - pascal_decl_attributes (d, attributes); + if (TREE_CODE (*d) == POINTER_TYPE || TREE_CODE (*d) == REFERENCE_TYPE) + pascal_decl_attributes (&(TREE_TYPE (*d)), attributes); + else + pascal_decl_attributes (d, attributes); }
void