Initializers containing function names

MICPRF at latvax8.lat.oz MICPRF at latvax8.lat.oz
Tue Mar 13 22:10:45 AEST 1990


Greetings net people,
	I don't know if anyone out there can help me but here is my
problem. In trying to install the S stats/graphics package on my
Sys V box I struck the following difficulty:
My cc compiler complains about illegal initialization if an attempt is
made to include a function name in an initializer. (The writer(s) of S
used this to set up a hash table of functions). According to the manuals
and references I have it should be perfectly OK. The function name should
be converted implicitly to a constant of type pointer to function and
should be able to used as an initializer. The following fragment illustrates
the problem:

int dummy(){};
int address = (int) dummy;

In the S code this type of thing is embedded in arrays of structures, for
the hash tables but the problem seems to come down to the above. Any hints
or suggestions for work arounds gratefully accepted. Perhaps others have
experienced similar problems? My machine is VME-bus M68010 based running
Sys V.2 (a Microforce 2, Force Computers, Munich).
				Paul Fisher,
				Microbiology Dept.,
				La Trobe University, Melbourne, Australia.
				(micprf at latvax8.lat.oz.au).



More information about the Comp.lang.c mailing list