386/3.0e bug in cc
Larry Jones
scjones at sdrc.UUCP
Fri Feb 3 08:28:05 AEST 1989
I just ran across a bug in the c compiler on 386/3.0e. If you
compare an unsigned constant expression to a signed constant
expression, the result of the comparison is computed at compile
time using a SIGNED comparison rather than an UNSIGNED comparison.
For example:
~(unsigned)0 < 1000
is evaluated as 1 when it should clearly be 0. If you stick in a
variable so that the compiler has to generate code, the code gets
the right answer.
----
Larry Jones UUCP: uunet!sdrc!scjones
SDRC scjones at sdrc.UU.NET
2000 Eastman Dr. BIX: ltl
Milford, OH 45150 AT&T: (513) 576-2070
"When all else fails, read the directions."
More information about the Comp.unix.microport
mailing list