Assignment to pointers to functions returning void

usenet usenet at abnjh.UUCP
Sun Mar 4 06:46:03 AEST 1984


>> /* Program demonstrates a bug in the VAX 4.1 BSD C compilier.
>>  * The following error messages is printed:
>>  * "junk.c", line 17: operands of = have incompatible types
>>  */
>> short 	f0();
>> void 	f1();
>> int 	f2();
>> 
>> main()
>> {
>>     short 	(*pf0)(); 
>>     void 	(*pf1)();
>>     int 	(*pf2)();
>> 
>>     pf0 = f0;
>>     pf1 = f1;			/* This is line 17 */
>>     pf2 = f2;
>> }

When I tried your program on System V on a VAX, I got no diagnostics
of the type mentioned.  Of course, there were some complaints about
undefined symbols when I tried to link the resulting dot-o. :=)
Rick Thomas



More information about the Comp.lang.c mailing list