[MPlayer-dev-eng] [PATCH] Drop support for gcc-2.95
Rich Felker
dalias at aerifal.cx
Wed Jul 12 18:29:59 CEST 2006
On Wed, Jul 12, 2006 at 10:26:41AM +0300, Uoti Urpala wrote:
> On Tue, 2006-07-11 at 20:39 -0400, Rich Felker wrote:
>
> <Some flames skipped>
>
> > > > > I was mainly thinking of C99 features like compound literals (which 2.95
> > > > > supports partially?)
> > > >
> > > > These are fully supported by gcc 2.95. I use them all the time. Named
> > >
> > > No they aren't. I tested it and my first testcase was miscompiled by
> > > gcc-2.95. Seems it considered the initialized value to be const when it
> > > wasn't.
> >
> > Could you explain? Are you sure your example is valid C?
>
> This is enough to reproduce the problem:
>
> int main(int argc, char *argv[])
> {
> int *p = (int []){0, 1};
> *p = 2;
> return 0;
> }
>
> This is valid C. gcc-2.95 miscompiles it, resulting in a segfault on my
> machine.
It is NOT valid C. The compound literal exists only for the current
statement. After that it ceases to exist and any pointer to it is
invalid.
> > I did. The fact that the ISO C committee can't figure out the
> > consequences of their own specification is irrelevant.
>
> I'm sure you understand the standard much better than those morons who
> wrote it.
They're not morons, but writing something does not necessarily mean
you've thought out every single implication of it. In fact that's
impossible. The only reason I was slightly mocking them is that they
intentionally said that the behavior is undefined (rather than saying
nothing) even though other parts of the spec clearly define it.
Rich
More information about the MPlayer-dev-eng
mailing list