[pooma-dev] signed == signed - sizeof(...), and other warning s... (non-POOMA C++ questions)

Jeffrey Oldham oldham at codesourcery.com
Tue May 1 20:25:38 UTC 2001


On Tue, May 01, 2001 at 01:10:27PM -0700, James Crotinger wrote:
> I guess this is just part of C's wonderful promotion rules - I found it in
> K&R. This is harmless, but annoying. 

I like the signed vs. unsigned warnings because it reveals type
mismatches.  To prevent gcc from producing the warning, use the
command-line option `-Wno-sign-compare'.

> -----Original Message-----
> From: James Crotinger [mailto:JimC at proximation.com]
> Sent: Tuesday, May 01, 2001 2:07 PM
> To: Mark Mitchell (E-mail)
> Cc: 'pooma-dev at pooma.codesourcery.com'
> Subject: [pooma-dev] signed == signed - sizeof(...), and other warnings...
> (non-POOMA C++ questions)
> 
> 
> 
> Hey Mark. Just a couple of C++ (non-Pooma related) questions. I was 
> somewhat surprised that -Wall flagged the following code with a 
> warning: 
> 
>   void bar() 
>   { 
>     int a, b; 
>     (void)(a == b - sizeof(int)); 
>   } 

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com



More information about the pooma-dev mailing list