Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!ndiamond From: ndiamond@watdaisy.UUCP (Norman Diamond) Newsgroups: net.lang.c Subject: Re: Addresses of static functions Message-ID: <6898@watdaisy.UUCP> Date: Wed, 30-Jan-85 13:35:04 EST Article-I.D.: watdaisy.6898 Posted: Wed Jan 30 13:35:04 1985 Date-Received: Thu, 31-Jan-85 00:32:40 EST References: <360@ecr.UUCP> Organization: U of Waterloo, Ontario Lines: 25 > The original question was, "Is it OK to take the address of a >>static<< > function, and pass it to a separately-compiled function?" > > This problem arose practically in Version 2.0 of the Venix system for the > IBM PC/XT ... they require a special form of call for inter-segment calls, > which they do not use for static calls, since they are guaranteed to remain > within a single segment. > > In reality, the answer might have to be "yes", making the Venix code in error. > The reason is that a function may invoke another function by address. I think that Venix is in error, for exactly this reason. They (and their customers) have not been the only Intel users to be burnt by this quirk, and C is not the only language in which this problem exists. If the address of the function is taken, anywhere in the source module, then the compiler should generate long calling sequences for the function. -- Norman Diamond UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!watdaisy!ndiamond CSNET: ndiamond%watdaisy@waterloo.csnet ARPA: ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa "Opinions are those of the keyboard, and do not reflect on me or higher-ups."