Steffen Netz schrieb:
#define ISR(a,b) #pragma vector = a ## _VECTOR \
        __interrupt void b(void)
..
> Error[Pe052]: expected a macro parameter name P:\vhdl\EKG\pgm\msp\isr_compat.h 68
>
> This is the same problem, I ran some times ago. The Preprocessor
> thinks about a parameter with any #foo (as #pragma in this case).
> Is there a switch in IAR to compile this things?

a # within a macro is used for stringification of a parameter, ## to join parameters with other text.

some compilers support a "pragma()" (or "__pragma()" etc) pseudo macro that can be used for pragmas within macros. i think IAR has something like that.

these problems are the reason for gcc to have __attribte__(()) and not using #pragmas at all ;-)

chris


Reply via email to