Here's a weird error that perhaps is just my misunderstanding of the MPLAB C18 compiler. When I try to put a Nop() between two nested "#if defined" instructions, I get a syntax error on the line of the Nop(). However, if I put the Nop() after the second "#if defined", everything compiles fine. Why? I tried to add curly brackets around the second "#if defined", but it didn't help.
#if defined(__18CXX)
#if defined(__18CXX)
#if defined(__18CXX)
Nop(); //error
#if defined(HI_TECH_C)
#if defined(HI_TECH_C)
#if defined(__18CXX)
#if defined(HI_TECH_C)
Nop(); //okay
Nop(); //okay
Last edited: