Patch by Junio C Hamano to workaround a gcc compiler bug.
authorGlenn L McGrath <bug1@ihug.co.nz>
Wed, 17 Sep 2003 00:22:26 +0000 (00:22 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Wed, 17 Sep 2003 00:22:26 +0000 (00:22 -0000)
commitd3612178b71b5c7d66252933c3e5a5980887c4ca
treeed281183851ef7f437520fe212efc54dea2faa80
parent2570b43e829ccfc0f199fe61aafc24b1bd3fc7b1
Patch by Junio C Hamano to workaround a gcc compiler bug.

The construct certain vintages of GCC (the one I have trouble
with is 3.2.3) have trouble with looks like the following:

    static struct st a;
    static struct st *p = &a;
    struct st { int foo; };
    static void init(void) { a.foo = 0; }

The problem disappears if we move the struct declaration up to
let the compiler know the shape of the struct before the first
definition uses it, like this:

    struct st { int foo; }; /* this has been moved up */
    static struct st a;
    static struct st *p = &a;
    static void init(void) { a.foo = 0; }
shell/ash.c