It looks like a nesC bug. The parentheses are removed by nesC, so gcc
rightfully complains.

The code in ConfigStorageP.nc (line 164 in function
'ConfigStorageP__mountCrcDone) is correct:
if ((high[id].version > low[id].version) == isflipped)

However, in the app.c file (line 8377 in my setup), a pair of parentheses is
removed:
if (__nesc_ntoh_uint32(ConfigStorageP__high[id].version.data) >
__nesc_ntoh_uint32(ConfigStorageP__low[id].version.data) == isflipped)

You can discard the warning, though. The < has higher precedence than the
==, so the code should run fine.

My setup is:

$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ./configure --target=avr --enable-languages=c --disable-nls
--disable-libssp --prefix=/usr
Thread model: single
gcc version 4.1.2

$ nescc -v -gcc=avr-gcc
nescc: 1.3.0
avr-gcc -_fnesc-gcc=avr-gcc -specs=/usr/lib/ncc/tdspecs
-_fnesc-include=nesc_nx -I/usr/lib/ncc -v -DNESC=130
Using built-in specs.
Reading specs from /usr/lib/ncc/tdspecs
Target: avr
Configured with: ./configure --target=avr --enable-languages=c --disable-nls
--disable-libssp --prefix=/usr
Thread model: single
gcc version 4.1.2

Janos

On Wed, Aug 12, 2009 at 12:51 PM, Miguel Torres <[email protected]>wrote:

> Hello,
>
> I'm using the iris platform and when try to compile some test
> application that involve the ConfigStorageP.nc appear this warning:
>
> [mrtsi...@irisblue Config]$ pwd
> /opt/tinyos-2.x/apps/tests/storage/Config
> [mrtsi...@irisblue Config]$ make iris
> mkdir -p build/iris
>    compiling RandRWAppC to a iris binary
> ncc -o build/iris/main.exe  -Os -fnesc-separator=__ -Wall -Wshadow
> -Wnesc-all -target=iris -fnesc-cfile=build/iris/app.c -board=micasb
> -DDEFINED_TOS_AM_GROUP=0x22 --param max-inline-insns-single=100000
> -Ibuild/iris -DIDENT_APPNAME=\"RandRWAppC\"
> -DIDENT_USERNAME=\"mrtsilva\" -DIDENT_HOSTNAME=\"irisblue\"
> -DIDENT_USERHASH=0xb6a8f65bL -DIDENT_TIMESTAMP=0x4a82ffbaL
> -DIDENT_UIDHASH=0xa857273aL -fnesc-dump=wiring
> -fnesc-dump='interfaces(!abstract())'
> -fnesc-dump='referenced(interfacedefs, components)'
> -fnesc-dumpfile=build/iris/wiring-check.xml RandRWAppC.nc -lm
> /opt/tinyos-2.x/tos/chips/at45db/ConfigStorageP.nc: In function
> 'ConfigStorageP__mountCrcDone':
> /opt/tinyos-2.x/tos/chips/at45db/ConfigStorageP.nc:164: warning:
> comparisons like X<=Y<=Z do not have their mathematical meaning
>    compiled RandRWAppC to build/iris/main.exe
>           11640 bytes in ROM
>            2153 bytes in RAM
> avr-objcopy --output-target=srec build/iris/main.exe build/iris/main.srec
> avr-objcopy --output-target=ihex build/iris/main.exe build/iris/main.ihex
>    writing TOS image
>
> The line 164 of ConfigStorageP have:
> if ((high[id].version > low[id].version) == isflipped)
>
>
> Is this warning critical? Or don't have any problem associated?
>
> Best Regards,
> --
> Miguel Torres Silva
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to