Hi,
> > when i use
> >
> > # ifndef __FUNCTION__
> > # define __FUNCTION__ __func__
> > # endif
> >
> > before
> >
> > _BIC_SR_IRQ (LPM4_bits); // line 42
>
> this macro uses string concatenation feature of the preprocessor to
> calculate the stack depth of the currrent frame (so that the generated
> insn "bic #const, offset(SP)" clears the bits on the copy of SR on the
> stack)
>
> "__func__" is a "const char *", string concatenation does not work there...
>
> gcc 3.2.3 defines __FUNCTION__. strange that the #ifndef does not "see" it.
yes, i can use on the PC e. g.
#include <stdio.h>
int main() {
printf("%s\n", __FUNCTION__);
return 0; }
and it compiles and the executable prints the function.
But when i use
#ifndef __FUNCTION__
# error
#endif
compilation always stops at #error and
#undef __FUNCTION__
does not work.
So for printf and other functions __FUNCTION__ is defined but it is
not defined for ifdef or defined() and it is impossible to undefine
__FUNCTION__!
The error message from mspgcc also vanishes when i comment or delete the line
_BIC_SR_IRQ (LPM4_bits);
It seems the change from the half to the full definition of __FUNCTION__
confuses
the _BIC_SR_IRQ macro.
Regards,
Rolf