>> so it seems clear that constants are treated as if unsigned, regardless,
>> but variables are not?
> 
> the really wierd bit is that the 1 in 1<<i suddenly becomes signed,
> even though other constants are treated as if unsigned, and i is
> unsigned.
> 
I would not hesitate to call that a bug.

I would also strongly advise you to leave well enough alone and not
rely on what the standard calls implementation choices for any code
you would like to be portable.  If it doesn't have to be portable,
check the compiler behaviour; then, as R.A. Heinlein would have it,
"revel in it".

++L


Reply via email to