[comp.sys.sgi] Compiler void support under 3.2

viktor@rutabaga.Princeton.EDU (Viktor Dukhovni) (12/14/89)

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@princeton.edu>	: ARPA
		<...!uunet!princeton!math!viktor>	: UUCP
	Fine Hall, Washington Rd., Princeton, NJ 08544  : US-Post
		+1-(609)-258-5792		 	: VOICE

davea@quasar.wpd.sgi.com (David B. Anderson) (12/16/89)

In article <12190@phoenix.Princeton.EDU>, viktor@rutabaga.Princeton.EDU (Viktor Dukhovni) writes:
> The following code is incorrectly rejected by the C compiler under 3.2
[spacing removed for brevity]
> void foo() {  } ;  void bar() {  } ;
> void (*z)() ;
> main() {
> 	z = bar ;
> 	z = (1==1) ? foo : bar ;
> }
[commentary deleted for brevity]

The problems with void and void * have been corrected in ccom for the release
after 3.2.

3.2 was complete before I got around to fixing this.   Sorry.

Regards,
[ David B. Anderson  Silicon Graphics  (415)335-1548  davea@sgi.com ]