From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sun, 1 Jul 2012 18:45:22 -0400 To: 9fans@9fans.net Message-ID: <0ed0a6d52f2a1c49363d9b032c8f178a@kw.quanstro.net> In-Reply-To: References: <19f6168fb6b109424ddbb1d276d62e6b@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] cc nit? Topicbox-Message-UUID: a0c7bc14-ead7-11e9-9d60-3106f5b1d025 > Many compilers do just that, however, that said, unless the compiler is > prepared for it, since it effectively yields a struct of zero size which > normally is a no-go, it could produce bugs involving sizeof, initializers, > pointer addition et al, even some divisions by zero if the compiler is > making certain assumptions already, unless it already can have zero length > objects of this nature for some other reasons. actually, kenc is pretty good about all these. if you have struct fu {void x;}; and take sizeof(struct fu), that will give a diagnostic error. the reason i avoided it was to not mess with the grammer, but if this is a common thing, maybe it's no big deal. though as charles points out, it is a bit of a waste of time. - erik