Originally Posted by
brightmatter
I have a bit of simple code here that seems to work fine in my program BUT, I get this warning and I cannot find the solution anywhere. So I turn to the forums. Inside this *.h file on a Fedora Linux box running Eclipse, I get the warning:
"parameter names (without types) in function declaration"
It is referring to the the affixed code. I am able to use this code to access a 'default' function inside each struct and override that function if I choose to do so.
Code:
typedef struct A {
char *(*aFunctionName)(APtr);
} *APtr;
I don't suppose anyone can tell me what I did wrong with so little information? This error shows up when using the gcc parameter -Wall and because I normally choose to use -Werror, it is irksome that I cannot make this go away.
This is an assignment for school and so I have to be careful how I ask the question and what information I include. This is the reason for the sparsity of the code. I hope I did not cut so much out that identifying the issue becomes impossible.
BM
Perhaps you mean:
Code:
typedef struct A {
char *(*aFunctionName)(struct A *);
} * APtr;
Since APtr is not yet a type, or even object. Forward type the structure. Or do as above.
FYI, I think it's a very dumb idea to typedef pointers (if that's what you were trying to do).