[Tinyos-help] __attribute__ ((C, spontaneous))
Tehn Yit Chin
tehn-yit.chin at greyinnovation.com
Wed Jul 5 17:13:03 PDT 2006
Philip Levis wrote:
> 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
Out of curiosity, would nesC also not perform any optimisation on this
bit of code as well, or is that left up to avr-gcc?
cheers,
Tehn Yit Chin
Embedded System Engineer, Grey Innovation Pty. Ltd.
More information about the Tinyos-help
mailing list