386/3.0e bug in cc
Dave Remien
dave at pmafire.UUCP
Sat Feb 4 04:37:43 AEST 1989
In article <524 at sdrc.UUCP> scjones at sdrc.UUCP (Larry Jones) writes:
:>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.
It's there, all right, using the cc (AT&T portable C compiler also used in
Bell Tech's System V/386), but not in either the Greenhills nor GNU C
compilers. Seems like a good reason to go GNU, yes? Actually, the
Greenhills C is pretty good as well; I just don't really like reading
the advertising for every module that gets compiled.
:>
:>----
:>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."
--
Dave Remien - WINCO Computer Engineering Group (only somewhat confused, now)
Work - 208-526-3523 Home - 208-524-1906 UUCP Path: ...!bigtex!pmafire!dave
"How can you be in two places at once, when you're not anywhere at all..."
More information about the Comp.unix.microport
mailing list