compile error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

compile error

Jump to solution
2,150 Views
Chaos
Contributor I
can someone please help. I get " ERROR: C2450: Expected: ~ ( INDENT auto const extern register static typedef volatile _interrupt"
 
I do not have a clue what this means.
I include the source
Labels (1)
Tags (1)
0 Kudos
1 Solution
828 Views
CompilerGuru
NXP Employee
NXP Employee
Count the opening and closing braces, the code is closing one more than it opens.


Code:
/*      572 */  void test_SPI ( void )
/*      573 */  {
/*      574 */    BYTE j , wr , rd ;
/*      576 */    wreg ( 17 << 3 , 0x10 ) ;
/*      577 */    wreg ( 15 << 3 , 0x20 ) ;
/*      578 */    wreg ( 15 << 3 , 0 ) ;
/*      579 */    wr = 0x01 ;
/*      580 */    for ( j = 0 ; j < 8 ; j ++ )
/*      581 */    {
/*      582 */      wreg ( 14 << 3 , wr ) ;
/*      583 */      rd = rreg ( 14 << 3 ) ;
/*      584 */      wr <<= 1 ;
/*      585 */    }
/*      586 */  }
/*      592 */  for ( ; ; ) { }
/*      594 */  }
 

View solution in original post

0 Kudos
4 Replies
828 Views
CrasyCat
Specialist III
Hello
 
I suspect some macros are not defined/expanded correctly.
 
Please create a pre-processor listing and check the proprocessing file around the line where the error is reported.
 
To generate the pre-processor listing:
  Click right on the C source file in the .mcp window and select preprocess in the context menu
 
CrasyCat
0 Kudos
828 Views
Chaos
Contributor I
thanks Crasycat
 
I did the preprocess but can't see anything suspicious. the error point to line 592 in the KDet.c file. its the second last line of the preprocess file tha t i have zipped here.
Would you please be so kind to see if you can find something.
 
thanx
0 Kudos
829 Views
CompilerGuru
NXP Employee
NXP Employee
Count the opening and closing braces, the code is closing one more than it opens.


Code:
/*      572 */  void test_SPI ( void )
/*      573 */  {
/*      574 */    BYTE j , wr , rd ;
/*      576 */    wreg ( 17 << 3 , 0x10 ) ;
/*      577 */    wreg ( 15 << 3 , 0x20 ) ;
/*      578 */    wreg ( 15 << 3 , 0 ) ;
/*      579 */    wr = 0x01 ;
/*      580 */    for ( j = 0 ; j < 8 ; j ++ )
/*      581 */    {
/*      582 */      wreg ( 14 << 3 , wr ) ;
/*      583 */      rd = rreg ( 14 << 3 ) ;
/*      584 */      wr <<= 1 ;
/*      585 */    }
/*      586 */  }
/*      592 */  for ( ; ; ) { }
/*      594 */  }
 
0 Kudos
828 Views
Chaos
Contributor I
Thanks Buddy
 
One tends to overlook the basic things and look for bigger complicated faults
0 Kudos