From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <19f6168fb6b109424ddbb1d276d62e6b@brasstown.quanstro.net> Date: Sun, 1 Jul 2012 18:22:17 -0400 Message-ID: From: Comeau At9Fans To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=14dae9399b3730711c04c3cc1d29 Subject: Re: [9fans] cc nit? Topicbox-Message-UUID: a0ac722e-ead7-11e9-9d60-3106f5b1d025 --14dae9399b3730711c04c3cc1d29 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jul 1, 2012 at 4:39 PM, Charles Forsyth wrote: > instead of trying to make void work as a data type declaration, it might > be clearer to accept an empty struct. 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. -- Greg Comeau / 4.3.10.1 with C++0xisms now in beta! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it? --14dae9399b3730711c04c3cc1d29 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Jul 1, 2012 at 4:39 PM, Charles Forsyth <charles.forsyth@g= mail.com> wrote:
instead of trying to make void work as a data type declaration, it might be= clearer to accept an empty struct.

Many compilers do just that, however, that said, unl= ess the compiler is prepared for it, since it effectively yields a struct o= f zero size which normally is a no-go, it could produce bugs involving size= of, initializers, pointer addition et al, even some divisions by zero if th= e compiler is making certain assumptions already, unless it already can hav= e zero length objects of this nature for some other reasons.

--
Greg Comeau / 4.3.10.1 with C++0xisms now in bet= a!
Comeau C/C++ ONLINE =3D=3D> =A0 =A0 http://www.comeaucomputing.c= om/tryitout
World Class Compilers: =A0Breathtaking C++, Amazing C99, Fabulous C90.=
Comeau C/C++ with Dinkumware's Libraries... Have you tried i= t?

--14dae9399b3730711c04c3cc1d29--