[Tinyos-help] Bug in NesC or a simple error.........???

Fabrizio Stefani fabrizio.stefani at arslogica.net
Fri Jan 26 05:54:23 PST 2007


You are right, with 2 bytes (uint16_t) you can represent signed numbers 
up to 32767, so every number greater than that value must be an unsigned 
value. This is why the compiler warns you.
If you use just unsigned values you can ignore the warnings.


Fabrizio.

Miguel Pereira wrote:
> Hi,
> 
> I already figure out what is the problem but there is something wrong 
> with nesC compiler.
> The problem is the number 65535. When I put this number in one variable 
> uint16_t, one warning fire, which is comprehensible because besides I'm 
> using the uint16_t the range could be of -32767 to 32767. If I put the 
> number 32767, all OK, but if I put 32768 all became wrong again. To 
> resolve the problem I thing in use the uint32_t type but happens exactly 
> the same.
> If I put uint32_t number = 32767 there is no problem but if I put 
> uint32_t number = 32768 the warning "decimal constant is so large that 
> it is unsigned" fire and I think this shouldn't happen.
> 
> Thanks for any help.
> 
> Miguel Pereira
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 

Fabrizio Stefani, Ph.D.
Researcher

ArsLogica S.r.l.
IT Laboratories

Business Innovation Centre
Unit 6 - 1st floor
BIC, Via Trento, 117
38017 Mezzolombardo
(TN), Italy

Email: fabrizio.stefani at arslogica.net
Skype: fabrizio.stefani
Phone: +39 0461 600253
Fax:   +39 0461 603250

Web Site: www.arslogica.it
_________________________________
This email has been ClamScanned !
          www.clamav.net
_________________________________


More information about the Tinyos-help mailing list