AnsweredAssumed Answered

Mysterious Compile Error with NV_data.c

Question asked by pamela_jennings pamela_jennings on May 18, 2009
Latest reply on May 18, 2009 by CompilerGuru

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

Outcomes