Hello,
I'm having difficulty compiling code for the MC13213 where I wasn't before. I know errors don't magically appear, but I'm at a lost with this one.
The compile error points to the NV_Data.c file. Neither I, nor to my knowledge other programmers on this project, have changed this file. I've copied the error messages below and the block of code it points to. I'm not sure if this error points to some other configuration problem in my codewarrior 5.9.0 project. I hope this is something simple that someone on this board can help me solve.
thanks,
ArtLab
/***********Code block with error*******************/
/*****************************************************************************
******************************************************************************
* Public functions
******************************************************************************
*****************************************************************************/
/*****************************************************************************
* locates the NV RAM to use.There are 2 NVM sectors.It sets apointer to
* valid sector.
*
* Interface assumptions:
*
* Return value:
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 290301 FSL,ANP Created
*****************************************************************************/
void NVM_FindNVRAM( void )
{
NvramSectorStruct_t * pSectorStruct;
NvramStruct_t *pMacStruct;
uint16_t iCounter = 0;
uint8_t mac[4] = "MAC";
uint8_t zs1[4] = "ZS1";
uint8_t zs2[4] = "ZS2";
/* Array of pointers to NVM Sectors */
void * apSectors[4] = { pStoredNvram0_c, pStoredNvram1_c, pStoredNvram2_c, pStoredNvram3_c};
gpMacNvram = NULL; /* MAC NVRAM Not found */
gapBeeStackNvram[0] = NULL;
gapBeeStackNvram[1] = NULL;
gpScratchPadNvram = NULL; /* SP NVRAM Not found */
/* loop to find the corresponding NVM sector */
for( iCounter = 0; iCounter < 4; iCounter++ ){
pSectorStruct = ( NvramSectorStruct_t * )( apSectors[ iCounter ] );
pMacStruct = ( NvramStruct_t * )( apSectors[ iCounter ] );
if( FLib_MemCmp(( void* )pSectorStruct->aString,
( void* )zs1, 3 )) {
gapBeeStackNvram[0] = ( NvramSectorStruct_t * )( apSectors[ iCounter ]);
}
else if( FLib_MemCmp(( void* )pSectorStruct->aString,
( void* )zs2, 3 )) {
gapBeeStackNvram[1] = ( NvramSectorStruct_t * )( apSectors[ iCounter ]);
}
else if( FLib_MemCmp(( void* )pMacStruct->MAC_Version,
( void* )mac, 3 )) {
gpMacNvram = ( NvramStruct_t * )( apSectors[ iCounter ]);
}
else {
gpScratchPadNvram = ( void * )( apSectors[ iCounter ]);
}
}
return;
}
/***********************************************/
/**************ERROR Messages******************/
Error : C2207: Initializer must be constant
NV_Data.c line 327
Error : C1815: NvramSectorStruct_t not declared (or typename)
NV_Data.c line 338
Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__
NV_Data.c line 338
Error : C1827: Arithmetic types expected
NV_Data.c line 338
Error : C1844: Call-operator applied to non-function
NV_Data.c line 338
Error : C1822: Type mismatch (expected 'NvramSectorStruct_tag *', given 'error ')
NV_Data.c line 338
Error : C1806: Illegal cast-operation
NV_Data.c line 338
Error : C1815: NvramStruct_t not declared (or typename)
NV_Data.c line 339
Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__
NV_Data.c line 339
Error : C1827: Arithmetic types expected
NV_Data.c line 339
Error : C1844: Call-operator applied to non-function
NV_Data.c line 339
Error : C1822: Type mismatch (expected 'NvramStruct_tag *', given 'error ')
NV_Data.c line 339
Error : C1806: Illegal cast-operation
NV_Data.c line 339
Error : C2801: ')' missing
NV_Data.c line 341
Error : C2801: ';' missing
NV_Data.c line 342
Error : C1814: Arithmetic or pointer-expression expected
NV_Data.c line 343
Error : C1815: NvramSectorStruct_t not declared (or typename)
NV_Data.c line 343
Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__
NV_Data.c line 343
Error : C1827: Arithmetic types expected
NV_Data.c line 343
Error : C1844: Call-operator applied to non-function
NV_Data.c line 343
Error : C1822: Type mismatch (expected 'NvramSectorStruct_tag volatile *', given 'error ')
NV_Data.c line 343
Error : C1806: Illegal cast-operation
NV_Data.c line 343
Error : C2801: '}' missing
NV_Data.c line 345
Error : C2801: ')' missing
NV_Data.c line 345
Error : C2801: ';' missing
NV_Data.c line 346
Error : C1814: Arithmetic or pointer-expression expected
NV_Data.c line 347
Error : C1815: NvramSectorStruct_t not declared (or typename)
NV_Data.c line 347
Error : C2450: Expected: . * + - & ! ~ ++ -- -> [ ( IDENT CONSTANT STRING sizeof __alignof__ __va_sizeof__ __va_arg_type__
NV_Data.c line 347
Error : C1827: Arithmetic types expected
NV_Data.c line 347
Error : C1844: Call-operator applied to non-function
NV_Data.c line 347
Error : C1822: Type mismatch (expected 'NvramSectorStruct_tag volatile *', given 'error ')
NV_Data.c line 347
Error : C1806: Illegal cast-operation
NV_Data.c line 347
Error : C2801: '}' missing
NV_Data.c line 349
Error : Compile failed
Solved! Go to Solution.
For any kind of mysterious compilation error in C, always check the preprocessor output.
If the preprocessor output on its own does not help you, save it as *.c and compile it, so the compiler
refers into it for its error message.
Maybe some name conflict in a included file.
Daniel
BTW: As note to the code, you could make the arrays static const so the compiler does not have to create
them on the stack, e.g.
static const uint8_t mac[4] = ...
static void * const apSectors[4] ={..
For any kind of mysterious compilation error in C, always check the preprocessor output.
If the preprocessor output on its own does not help you, save it as *.c and compile it, so the compiler
refers into it for its error message.
Maybe some name conflict in a included file.
Daniel
BTW: As note to the code, you could make the arrays static const so the compiler does not have to create
them on the stack, e.g.
static const uint8_t mac[4] = ...
static void * const apSectors[4] ={..
Hi,
When I transplant a project from CW6.3 to CW11.1, I encountered similar problem. The build problems are as below. I try to save related files as *.c, but it is no effect. Is there any method to resolve the problem?
C1815 TIME_1MIN not declared (or typename) fault.c /ABC210_CT_SX005/Sources line 297 C/C++ Problem
C2801 ';' missing fault.c /ABC210_CT_SX005/Sources line 302 C/C++ Problem
C1801 Implicit parameter-declaration for 'CheckTickTime' fault.c /ABC210_CT_SX005/Sources line 153 C/C++ Problem
C1801 Implicit parameter-declaration for 'TickTime' fault.c /ABC210_CT_SX005/Sources line 217 C/C++ Problem
C1814 Arithmetic or pointer-expression expected fault.c /ABC210_CT_SX005/Sources line 314 C/C++ Problem
C2801 '}' missing fault.c /ABC210_CT_SX005/Sources line 322 C/C++ Problem
C2801 ')' missing fault.c /ABC210_CT_SX005/Sources line 314 C/C++ Problem
C2450 Expected: { IDENT auto break case const continue default do extern for goto if register return static switch typedef volatile while __asm __interrupt fault.c /ABC210_CT_SX005/Sources line 314 C/C++ Problem
C1801 Implicit parameter-declaration for 'CheckTickTime1Ms' time.c /ABC210_CT_SX005/drive line 62 C/C++ Problem
C2801 ';' missing time.c /ABC210_CT_SX005/drive line 89 C/C++ Problem
C1814 Arithmetic or pointer-expression expected time.c /ABC210_CT_SX005/drive line 90 C/C++ Problem
C1815 TICK_TIME_LIMIT not declared (or typename) time.c /ABC210_CT_SX005/drive line 87 C/C++ Problem
mingw32-make: *** [Sources/fault_c.obj] Error 1 ABC210_CT_SX005 C/C++ Problem
C2801 ')' missing time.c /ABC210_CT_SX005/drive line 89 C/C++ Problem
mingw32-make: *** Waiting for unfinished jobs.... ABC210_CT_SX005 C/C++ Problem
mingw32-make: *** [drive/time_c.obj] Error 1 ABC210_CT_SX005 C/C++ Problem
C1814 Arithmetic or pointer-expression expected fault.c /ABC210_CT_SX005/Sources line 326 C/C++ Problem
C2450 Expected: { IDENT auto break case const continue default do extern for goto if register return static switch typedef volatile while __asm __interrupt fault.c /ABC210_CT_SX005/Sources line 326 C/C++ Problem
C2801 ')' missing fault.c /ABC210_CT_SX005/Sources line 326 C/C++ Problem
C2801 ';' missing fault.c /ABC210_CT_SX005/Sources line 324 C/C++ Problem
C2801 '}' missing fault.c /ABC210_CT_SX005/Sources line 335 C/C++ Problem
C2801 ';' missing fault.c /ABC210_CT_SX005/Sources line 332 C/C++ Problem
Best regards,
Sarah