[Tinyos-devel] Safe TinyOS pointer annotations
David Gay
dgay42 at gmail.com
Mon Feb 25 16:19:01 PST 2008
On Mon, Feb 25, 2008 at 11:09 AM, Octav Chipara <ochipara at gmail.com> wrote:
> Could the same thing be realized by defining special data types? I'm
> thinking that all this could be handled in the same way we handle
> network types. It could also make thinks look more like standard c and
> solve the incompatibility problem between different versions of nesc.
Except if something is broken, the annotations should work in
typedefs. However, typedef's are rarely meaningful for the annotations
with arguments (@count(blah)), as blah typically needs to refer to
expressions only available at the point of use. E.g. in
void f(int *@count(n) x, int n);
there's no useful typedef for 'int *@count(n)' ...
Note also one drawback about making the _or_null annotations too
verbose: within data structures, you need to use the _or_null
versions, because the initial state of pointers in data structures is
nearly always null.
David
More information about the Tinyos-devel
mailing list