On 2006-03-22, David Dyck <david.d...@fluke.com> wrote:

>> It would be good to add a note to the manual section for
>> _BIS_SR_IRQ() and _BIC_SR_IRQ() explaining that they _must_ be
>> called from the "top-level" of an ISR.  They must be called
>> directly by the function which was declared as an interrupt
>> handler.
>
> Great idea - how may people have been burned by this :-)

More than just me? ;)

Even after I looked at the macro a few days ago and _knew_ it
was using __FUNCTION__ to find the frame offset, I still did
the wrong thing.

> I wonder if there is a way for the compiler to detect this
> when it is expanding the macro?

I don't think so.  At least not using the mechanism that's
being used with gcc 3.x. The compiler's latter stages know
about function attributes, but the preprocessor doesn't (and
can't).  At the time the pre-processor is expanding the macro,
none of the attribute stuff has been parsed yet.

In the 4.0 implimentation a compiler builtin is being used
instead of a macro, so it might be possible in that case.

-- 
Grant Edwards                   grante             Yow!  Yow! Am I JOGGING
                                  at               yet??
                               visi.com            


Reply via email to