cheader-filesredeclaration

C: re-declaring with different type when all types are the same


I have a header file that contains this function declaration:

bool isAbelianGroup(ConstGroupMemberP IdentityElement, ConstGroupMemberP members[],
                const int membersLen, const binaryOp oper, const freeMember freeMember,
                const GroupComparator compare);

I have a c file in which I implement this function (copy-pasted the prototype from the declaration in the h file)

bool isAbelianGroup(ConstGroupMemberP IdentityElement, ConstGroupMemberP members[],
                const int membersLen, const binaryOp oper, const freeMember freeMember,
                const GroupComparator compare){...}

and yet, I get an error for re-declaring with different type:

enter image description here

Any ideas what might be the problem?


Solution

  • Found the problem: I should have written const freeMember freeFunc in both h and c files instead of const freeMember freeMember.

    That was hard to find.