Quirk in assignment of pointers to functions ..

Badri Lokanathan badri at ur-helheim.UUCP
Wed Jan 29 07:28:15 AEST 1986


The following problem may have been discussed before on this
newsgroup; I came across it just recently. 

Consider the following (perfectly valid) statements:
int abc(), (*f)();
   .
   .
   .
f = abc;

This works (as per K & R) and all is well.
Now consider 
void abc(), (*f)();
   .
   .
   .
f = abc;

This was not accepted by our preprocessor (we run BSD4.2). However, code
equivalent to this appears in spice3 (the latest release of spice
from Berkeley.) I understand spice3 was written on BSD4.3, which leads
me to believe that the 4.3 preprocessor handles things slightly
differently. Any comments??

Badri
 ___________________________________________________________________
'								    `
| ARPA    : ur-helheim!badri at rochester.arpa			    |
| UUCP	  : {allegra,cmcl2,cornell,decvax,harvard,seismo,topaz}	    |
| 	    !rochester!ur-helheim!badri 	    		    |
| USMAIL  : 56 Lansdale St. Rochester NY14620			    |
| PHONE   : off. (716)-271-6624    (716)-275-4066  -5139  	    |
| 	  : res. (716) 442-1578					    |
`-------------------------------------------------------------------'



More information about the Comp.lang.c mailing list