From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2621 Path: news.gmane.org!not-for-mail From: Igmar Palsenberg Newsgroups: gmane.linux.lib.musl.general Subject: Re: malloc(0) behaviour Date: Wed, 16 Jan 2013 08:46:06 +0100 Message-ID: <00EE43AB-50FC-49AB-A899-5D47422AF4C4@palsenberg.com> References: <20130114180533.GP20323@brightrain.aerifal.cx> <20130115110618.GA4468@port70.net> <4FA1FD0D-5C34-4DE0-AF27-1F48BB194005@palsenberg.com> <20130115134802.GY20323@brightrain.aerifal.cx> <20130115232220.GF2511@headless> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1358322377 3967 80.91.229.3 (16 Jan 2013 07:46:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2013 07:46:17 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2622-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 16 08:46:36 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TvNhj-0005Gw-JZ for gllmg-musl@plane.gmane.org; Wed, 16 Jan 2013 08:46:35 +0100 Original-Received: (qmail 16216 invoked by uid 550); 16 Jan 2013 07:46:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 16208 invoked from network); 16 Jan 2013 07:46:18 -0000 In-Reply-To: <20130115232220.GF2511@headless> X-Mailer: Apple Mail (2.1499) Xref: news.gmane.org gmane.linux.lib.musl.general:2621 Archived-At: >>> 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. >>=20 >> GCC thinks otherwise >=20 > 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. True. I just wanted to indicate that because it compiles, it ends up = being used, and considered "standard code". Unportable in theory, but this kind of extensions enabled by default causes this. The same = goes for zero-length arrays if I remember correctly. I still need to lookup how to disable those. Igmar=