From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Message-id: <0C7EEB36-319B-472C-8AC4-601D7AC5F874@mac.com> From: Pietro Gagliardi To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Content-transfer-encoding: quoted-printable Date: Sun, 29 Jun 2008 09:57:31 -0400 References: Subject: Re: [9fans] kenc: casting expression to void not ignored Topicbox-Message-UUID: cb5851e0-ead3-11e9-9d60-3106f5b1d025 I forgot to mention this is with the -w option; I found that turning =20 it off also hid warnings I wanted to keep. On Jun 29, 2008, at 9:53 AM, Pietro Gagliardi wrote: > Hello. I have a simple push macro for a stack machine interpreter. =20 > It looks like this: > > #define push(s) ((void)(((stackptr >=3D (stack + stacksize)) ? =20= > growstack() : (void)0), (*stackptr++ =3D errcheck(s)))) > > Does this boggle the mind? It's very simple: it checks for stack =20 > overflow and makes the stack bigger if so, then checks to see if s, =20= > a double, is NaN or =B1Inf, and finally pushes it onto the stack if =20= > not (errcheck calls longjmp - how I wish I had try). > > However, when I use the push macro, I get tons of warnings like this: > > warning: run.c:170 result of operation not used > > Shouldn't the cast to void mean that I don't intend to use the =20 > result of the operation? Thanks. > >