This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Window 10 Pro 64-bit
CCS Version: 8.3.0.00009
I am having problems refactoring a project. I used "Rename" function in the project explorer and renamed header and source file. I get this error after when trying to compile:
"error #148: declaration is incompatible with ..."
Header : void HandleTP150_TP200ExtraData_IRQ(char,char);
Source: void HandleTP150_TP200ExtraData_IRQ(char cDataGr, char cDataNode)
Looking at the source and header file from the project viewer with file expanded it shows the function has char parameters in header signature and unsigned char in source signature. See pictures. I tried renaming other files and I get a log of these errors. What am I doing wrong?
When you say ...
Jerker Dahlblom said:I used "Rename" function in the project explorer and renamed header and source file.
... I presume, while in the Project Explorer view, you right click on the name of a file, and choose Rename. When you rename a header file, you have to manually change the #include directives which use that filename. Did you do that?
I created a small test case out of these source lines ...
Jerker Dahlblom said:Header : void HandleTP150_TP200ExtraData_IRQ(char,char);
Source: void HandleTP150_TP200ExtraData_IRQ(char cDataGr, char cDataNode)
I am unable to reproduce the problem. I suspect something else is going on. To catch it, please add the build option --gen_preprocessor_listing. Please search for that option in the MSP430 compiler manual. This option causes the text file tp150g.rl to be created. Among other things, it shows source lines both before and after preprocessing occurs. I think there is a good chance you will see something you don't expect.
Thanks and regards,
-George
OK, so for me the "Rename" function changed all includes wherever the file was in an #include.
Thank you, now I see the following in the tp150g.rl :
Nvoid HandleTP150_TP200ExtraData_IRQ(char cDataGr, char cDataNode)
Xvoid HandleTP150_TP200ExtraData_IRQ(unsigned char cDataGr, unsigned char cDataNode)
E "../source/tp150g.c" 598 6 declaration is incompatible with "void HandleTP150_TP200ExtraData_IRQ(char, char)" (declared at line 120 of "C:/dev/repos/TP-150G/header/tp150g.h")
And the signatures from header and source files are :
void HandleTP150_TP200ExtraData_IRQ(char,char); <= Header
void HandleTP150_TP200ExtraData_IRQ(char cDataGr, char cDataNode) <= Source
But if I change header to this and keeping source file as is :
void HandleTP150_TP200ExtraData_IRQ(unsigned char,unsigned char);
void HandleTP150_TP200ExtraData_IRQ(char cDataGr, char cDataNode
it compiles just fine(?).
There is something not quite right here and this is unfortunately beyond my CCS / C knowledge. If you look at the original screenshots from the Project Explorer it looks like there is something wrong as the header shows a different signature compared to the source even though they are the same in the files. And it seems to concern the char datatype, now after looking I can see same problem in other places too.