Compiler void support under 3.2

Viktor Dukhovni viktor at rutabaga.Princeton.EDU
Thu Dec 14 11:40:50 AEST 1989


The following code is incorrectly rejected by the C compiler under 3.2
-------------------------
void foo() {
} ;
void bar() {
} ;

void (*z)() ;

main() {
	z = bar ;
	z = (1==1) ? foo : bar ;
}
---------------------------------

	Note that  z=bar is ok,  but the almost equivalent line below
which should set z=foo is not.  It appears the cc forgets the types
of the arguments of ?:

	I ran into this when porting Perl (which noticed this during
configure and reported incorrect handling of void function pointers.),
and when porting RCS,  which bombed  (the configuration does not provide
for broken compilers)

-- 
	Viktor Dukhovni <viktor%math at princeton.edu>	: ARPA
		<...!uunet!princeton!math!viktor>	: UUCP
	Fine Hall, Washington Rd., Princeton, NJ 08544  : US-Post
		+1-(609)-258-5792		 	: VOICE



More information about the Comp.sys.sgi mailing list