But it looks like Martin uses it on an unsigned char and 
not on a bit variable. I doubt it will create a problem 
here. Probably not even suboptimal code.

Maarten

> In SDCC, use ! instead of ~ to flip a bit.
> 
> 
> -----Original Message-----
> From: Martin Leopold <[email protected]>
> To: [email protected]
> Sent: Fri, 16 Jan 2009 9:21 am
> Subject: [Sdcc-user] New TinyOS 8051 platform results in non zero exit code
> 
> 
> 
>  All.
> I've recently added ported my 8051-TinyOS to a new platform, and I
> thought I might give SDCC a spin, but unfortunately I'm having some
> problems (the platform is a SiLabs c8051F340, but I hardly think that is
> the problem). I've used the sdcc-nf 2.8.0 distributed with Ubuntu.
> 
> The attached app.c results in a bunch of warnings, but no errors, but
> sdcc returns a non zero exit code (at least my makescript says so), so I
> suppose something went wrong!?
> 
> The warnings give rise to a different question regarding "~". I'm using
> ~ to turn certain bits of in a register, eg. "myreg |= MYBITMASK;myreg
> &= ~MYBITMASK". Is there an other convenient way to do the same that
> avoids the integer-promotion that the compiler warns about?
> 
> Anyway, the command and errors are:
> sdcc -mmcs51 --model-large --no-c-code-in-asm --std-sdcc99 app.c -oapp
> build/c8051F340TB/app.c:1221: warning 84: 'auto' variable 'i' may be
> used before initialization
> build/c8051F340TB/app.c:1610: warning 180: using ~ on bit/bool/unsigned
> char variables can give unexpected results due to promotion to int
> build/c8051F340TB/app.c:1687: warning 180: using ~ on bit/bool/unsigned
> char variables can give unexpected results due to promotion to int
> build/c8051F340TB/app.c:1769: warning 85: in function
> SchedulerBasicP__TaskBasic__default__runTask unreferenced function
> argument : 'id'
> build/c8051F340TB/app.c:2002: warning 126: unreachable code
> build/c8051F340TB/app.c:2002: warning 126: unreachable code
> build/c8051F340TB/app.c:2002: warning 126: unreachable code
> 
> -- 
> Regards Martin Leopold.
> 
> 
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> 
> 
> 
> _______________________________________________
> Sdcc-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
> 
> 



------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to