Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130115232220.GF2511@headless>
Date: Tue, 15 Jan 2013 23:22:20 +0000
From: Rob <robpilling@...il.com>
To: musl@...ts.openwall.com
Subject: Re: malloc(0) behaviour

On Tue, Jan 15, 2013 at 11:28:14PM +0100, Igmar Palsenberg wrote:
> >> That's there to access if size is 0 ? Sure, you can access :
> >>
> >> struct foo {
> >> };
> >
> > This is a constraint violation. C does not allow empty structs, and
> > even if it did, they would not have size 0, since no type or object
> > ever has size 0 in C.
>
> GCC thinks otherwise

Therein lies the problem.
It's an extension, as are a multitude of other things such as ?:
expressions missing the middle expression and ({...}) and so on. Clang
also implements these, as do other compilers such as tcc.

Rob

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.