C Compiler bug (and fix for a different one)

Mike Shannon mikes at apple.UUCP
Tue Aug 5 18:19:54 AEST 1986


Just to be sure we're all on the same wavelength about void expressions
with the ?: operator:
	Consider the case where you're writing a really complex #define macro,
and you decide that you'd like some sort of IF statement in it,
(take a look at getchar()).  Can't you see a case where you might want to
call a void function, and then set the value of the #define macro to be
a side effect of the function?  Sort of like
#define foo(c) buffer_empty?fill_buff(),first_char_in_buf:first_char_in_buf
	I mean, it seems to me that the 'pro' argument is that you get flow of
control in #define's. Although when you way that 'void things cannot participate
in expressions', a rational person would say that conditional expressions are
expressions and so you can't have a void thing in that kind of expression.
-- 
			Michael Shannon {apple!mikes}



More information about the Net.bugs mailing list