[BusyBox] Where do I report a compiler bug?
Lars Kellogg-Stedman
lars at larsshack.org
Mon Oct 13 13:59:54 UTC 2003
I don't believe this is a compiler bug. The C programming FAQ says that
this behavior is undefined:
From <http://www.eskimo.com/~scs/C-faq/q3.1.html>:
[3.1] Why doesn't this code:
a[i] = i++;
work?
---
The subexpression i++ causes a side effect--it modifies
i's value--which leads to undefined behavior since i is also
referenced elsewhere in the same expression. (Note that
although the language in K&R suggests that the behavior of
this expression is unspecified, the C Standard makes the
stronger statement that it is undefined--see question
11.33.)
References: K&R1 Sec. 2.12
K&R2 Sec. 2.12
ANSI Sec. 3.3
ISO Sec. 6.3
-- Lars
> > > /* Bug: this fails to move array */
> > >
> > > while(i) {
> > > mtfSymbol[i] = mtfSymbol[--i];
> > > }
> >
> > Are you sure this is a compiler bug? Or is it undefined behaviour?
>
> Yes, I'm sure it's a compiler bug.
--
Lars Kellogg-Stedman <lars at larsshack.org>
More information about the busybox
mailing list