Re: What's wrong with alloca() in gcc????

ted@nmsu.edu
Tue, 31 Dec 91 13:36:24 MST

          From comp.compilers

Related articles
What's wrong with alloca() ? preston@dawn.cs.rice.edu (1991-12-19)
Re: What's wrong with alloca() in gcc???? mo@gizmo.bellcore.com (1991-12-31)
Re: What's wrong with alloca() in gcc???? ted@nmsu.edu (1991-12-31)
Re: What's wrong with alloca() in gcc???? angular!jas@Sun.COM (1992-01-01)
Re: What's wrong with alloca() in gcc???? tarjeij@ulrik.uio.no (1992-01-02)
| List of all articles for this month |

Newsgroups: comp.compilers
From: ted@nmsu.edu
Keywords: storage, GCC
Organization: Compilers Central
References: 91-12-090 91-12-075
Date: Tue, 31 Dec 91 13:36:24 MST

mo@gizmo.bellcore.com (Michael O'Dell) writes:
          At least at one time, the dynamic array stuff in gcc was very broken
          in that if you have


int foo[z];


          sizeof(foo) returned sizeof(int).


this has been fixed as of version 1.40


> cat x.c
foo(n)
int n;
{
        int z[n];


        printf("%d\n", sizeof(z));
}


void main()
{
        foo(3);
        foo(4);
}
> x
12
16




          This is so wrong as to be beyond belief.


With bugs and computers, it is hard to find something beyond belief.


It certainly was a relatively straightforward bug to introduce, and it
probably wasn't all that hard to fix. Certainly the existence of this
bug is not an indication that gcc is not a good compiler. In fact, it
is an excellent compiler. And the price is very hard to beat.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.