AnsweredAssumed Answered

Compiler Bug???

Question asked by Phillip WOLSTENCROFT on Mar 25, 2008
Latest reply on Apr 2, 2008 by Phillip WOLSTENCROFT
Hi all,
 
Am using the latest version of CW for the HCS12.
 
When defining a macro does the compiler ignore the "\" command that tells it the code continues on the next line.
 
Let me explain. In the following macro
 
#define OSEnterCritical()               do {  __asm PSHC;    \
                                                                __asm SEI;        \
                                                               DiHook();            \
                                                        } while (0)
 
the second and third lines are ignored when compiling.
 
If you put those lines on the same line as the first all is ok.
 
#define OSEnterCritical()               do {  __asm PSHC;  __asm SEI;  DiHook();  \
                                                        } while (0)
 
 
The strange thing is that if you take a C file that uses the macro and you right click and perform a
preprocess of the file it produces the same output for either method.
If you instead generate a disassembly file only the later method works.
 
No errors or warnings are generated.
 
Anybody seen this or know what I'm doing wrong?
 
regards
Phil


 

Outcomes