MSC 5.1 bug ??

david nugent david at csource.oz.au
Sun Feb 25 04:06:27 AEST 1990


In a message dated 22-Feb-90, Kevin D. Quitt writes:

 >Your head was on right; I couldn't believe it either.  I suspected
 >then disproved: 1) -1 generated 0x0000FFFF instead of 0xFFFFFFFF, 2) an
 >unsigned comparison.
 >
 >
 >;|***   if ( l  >=  (i & 1 ) )



This is fairly typical behaviour.  I've seen similar things on a number of compilers, though I can't find any reason why automatic type conversions should do this.

'l' is being resolved as an int prior the comparison.

  Try: 

          if ( l >= (long) (i & 1) )

and you'll get something quite different.


david

--  
     UUCP: ...!munnari!csource!david  <Fido/ACSNET Gate>
 Internet: david at csource.oz.au
  FidoNet: 3:632/348



More information about the Comp.lang.c mailing list