Error: identifier something(char) redeclared as void something(char)

Discussion created by FridgeFreezer on Nov 25, 2009
Latest reply on Dec 1, 2009 by CompilerGuru

As part of a project to migrate from an MCORE project in CW5 to MCF5225x in CW 7.1.1a, I have loaded (a duplicate of) the example project (MCF52259EVB/example.mcf) in CW 7.1 (the version that came with the EVB) and then pasted the main source & header files from the old CW5 project into the new project - the plan being to hit "build" and see all the stuff that breaks, then work through it tweaking old code to point to the new CPU/EVboard definitions to hopefully end up with a working demo.


Anyway, one thbing I didn't expect was for CW to throw errors for what seems like every single function declaration.


For example:


In buffers.c:

void buffer_init(struct buffer_struct *buffer)



In buffers.h:

void buffer_init(struct buffer_struct *buffer);


The error messages take the form:


Error: identifier 'buffer_init(struct buffer_struct *)' redeclared as 'void void buffer_init(struct buffer_struct *)' in buffers.c





Error: identifier 'buffer_init(struct buffer_struct *)' was originally declared as 'void void buffer_init(struct buffer_struct *)' in buffers.h


The compiler also throws errors like this for some code, claiming illegal conversion between identical types:


Error: Illegal implicit conversion from 'struct buffer_struct *' to 'struct buffer_struct *'


 I don't know if this lot is due to an incorrect compiler setting or a different C standard from the old version of CW to the new one. Can anyone shed any light?