I am working with a C89 compiler and I'm coming across some pointer typing error.
Calling code:
struct cpu_state_type cpu_state;
//Stuff here....
foo()
{
print_out_cpu(&cpu_state);
}
Print_out_cpu is defined elsewhere and the H file is #included in.
struct cpu_state_type
{
int r[12];
};
void print_out_cpu(struct cpu_state_type *c);
I get error:
error: incompatible type for argument 1 of 'print_out_cpu'
As best as I can understand,&cpu_state
returns type cpu_state_type*
, so I am confused.