[Tinyos-8051wg] Re: [Tinyos-2.0wg] Bug in nesC 1.2alpha10
Cory Sharp
cory.sharp at gmail.com
Fri May 20 14:07:25 PDT 2005
Just for the record... A reasonable alternative is to define generic
components of the form MyComponent(max_clients) instead of
MyComponent(special_string). In practice, instantiation of those
components looks like
new MyComponent(uniqueCount(special_string))
instead of
new MyComponent(special_string)
This is what the timer system does for VirtualizeTimerC and it works
fine. I even assert this should be the standard practice since the
max_clients form seems more general. The special_string form doesn't
provide any additional abstraction for the use-cases I've heard so
far.
Cory
On 5/20/05, Joe Polastre <joe.polastre at gmail.com> wrote:
> I believe there is a bug in the new nesC with passing strings into a component.
>
> I think that if you pass in a string and the string is used in
> "uniqueCount", nesC is evaluating uniqueCount at the time that file is
> processed rather than waiting until the full program is processed and
> then assigning uniqueCount values.
>
> To see the bug, compile apps/TestSPI for telosb. You will get the
> "comparison is always false due to limited range of data type" even
> though the uniqueCount value should equal 2!
>
> -Joe
>
> $ make telosb
> mkdir -p build/telosb
> compiling TestSPIC to a telosb binary
> ncc -o build/telosb/main.exe -Os -O -mdisable-hwmul
> -I/home/polastre/cvs/tinyos-2.x/tos/lib/CC2420Radio
> -I/home/polastre/cvs/tinyos-2.x/tos/../beta/STM25P/STM25P -Wall
> -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=telosb
> -fnesc-cfile=build/telosb/app.c -board= TestSPIC.nc -lm
> nesc1: warning: calls to SoftwareInit.init in RealMain are uncombined
> C:/PROGRA~1/UCB/cygwin/home/polastre/cvs/tinyos-2.x/tos/interfaces/BusArbitration.nc:
> In function `BusArbitrationM$0$busReleased$runTask':
> C:/PROGRA~1/UCB/cygwin/home/polastre/cvs/tinyos-2.x/tos/interfaces/BusArbitration.nc:49:
> warning: comparison is always false due to limited range of data type
> compiled TestSPIC to build/telosb/main.exe
> 3320 bytes in ROM
> 52 bytes in RAM
> msp430-objcopy --output-target=ihex build/telosb/main.exe build/telosb/main.ihex
> writing TOS image
>
> _______________________________________________
> Tinyos-2.0wg mailing list
> Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
>
>
_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
More information about the Tinyos-8051wg
mailing list