Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.lang.c,net.bugs Subject: Re: C Compiler bug (and fix for a different one) Message-ID: <3183@utcsri.UUCP> Date: Sun, 27-Jul-86 04:48:08 EDT Article-I.D.: utcsri.3183 Posted: Sun Jul 27 04:48:08 1986 Date-Received: Sun, 27-Jul-86 05:45:08 EDT References: <273@watmath.UUCP> <5858@alice.uUCp> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 25 Summary: In article <5858@alice.uUCp> ark@alice.UucP (Andrew Koenig) writes: >> So, does anyone have a fix for this bug? >> I'll trade for a fix for a problem with void functions and the ?: operator. >> >> void f3(which) >> { >> extern void f1(),f2(); >> which?f1():f2(); >> } >> cc(1) gives an "incompatible types" error. > >As it should. The only thing you're allowed to do with void values >is throw them away. But it is being thrown away. In e1?e2:e3, the contexts of e2 and e3 are inherited from the context of the ?: operator itself. In this case, that is in a 'for effect' or void context, so f1() and f2() should be treated as 'thrown away' too. -- "You'll need more than a Tylenol if you don't tell me where my father is!" - The Ice Pirates ---------------------------------------------------------------------- Greg Smith University of Toronto UUCP: ..utzoo!utcsri!greg