Example Program: a[i]=b[i++] non-portability
Joseph S. D. Yao
jsdy at hadron.UUCP
Tue Apr 8 15:39:15 AEST 1986
In article <357 at g.cs.cmu.edu>, ckk at g.cs.cmu.edu (Chris Koenigsberg) writes:
> We ran into a similar problem with a section of code containing
> "i=0; while(i<N) a[i] = b[i++];"
> and we found that the Sun 120 4.2 C compiler decided that a[0] gets b[1],
> while the IBM RT PC ACIS 4.2 C compiler decided that a[1] gets b[1] and a[0]
> gets nothing (remains null, if it was initialized this way).
In article <359 at g.cs.cmu.edu> ckk at g.cs.cmu.edu (Chris Koenigsberg) writes:
>On the sun, a[0] gets b[0], but on the RT PC, a[1] gets b[0] and a[0] is
>a null.
Note that one says a[1] <- b[1] and t'other says a[1] <- b[0] on the
RT PC. Chris, now do you understand what folks were getting upset
over? (Hint: the former.)
More information about the Comp.lang.c
mailing list