what is this supposed to do?
Stephen Clamage
steve at taumet.com
Thu Apr 25 01:08:45 AEST 1991
langer at gibbs.uchicago.edu (Steve Langer) writes:
>What is the expected output from the following program? Is it defined?
>#include <stdio.h>
>main() {
> printf("1 << 32 = %o\n", ((unsigned) 1) << 32);
>}
It is not defined, so the variation in outputs you got is legal.
In 3.3.7, the Standard says "If the value of the right operand
[of the shift operator] ... is greater than or equal to the width in
bits of the promoted left operand, the behavior is undefined."
--
Steve Clamage, TauMetric Corp, steve at taumet.com
More information about the Comp.lang.c
mailing list