[Tinyos-help] __attribute__ ((C, spontaneous))

Philip Levis pal at cs.stanford.edu
Wed Jul 5 11:36:55 PDT 2006


On Jul 5, 2006, at 11:24 AM, Adam wrote:

> I notice GenericComm has this following function:
>
> TOS_MsgPtr handleReceived(TOS_MsgPtr packet)  __attribute__ ((C,
> spontaneous))
>
> I am curious that what's the difference if we use __attribute__ ((C,
> spontaneous)) or not to define an global function? I have written  
> several
> global function without using the _attribute, it seems working fine  
> so far.

Dead code elimination. Spontaneous tells nesC that the function might  
be called from "elsewhere" and therefore shouldn't be removed.

Phil


More information about the Tinyos-help mailing list