Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!sdd.hp.com!uakari.primate.wisc.edu!uflorida!pine.circa.ufl.edu!dwatney From: dwatney@pine.circa.ufl.edu (SUTHERLAND) Newsgroups: comp.lang.c Subject: Re: Casting to far proc ptr Message-ID: <24741@uflorida.cis.ufl.EDU> Date: 5 Oct 90 19:17:33 GMT References: <2734@crdos1.crd.ge.COM> Sender: news@uflorida.cis.ufl.EDU Reply-To: dwatney@pine.circa.ufl.edu Distribution: usa Organization: University of Florida - pine.circa.ufl.edu Lines: 22 News-Software: VAX/VMS VNEWS 1.3-4 In article <2734@crdos1.crd.ge.COM>, davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) writes... > I need to pass to address of a procedure to a called function. The >procedure is near static, and I need to cast to far, or assign the >address to a far ptr. The differences between near and far functions exist beyond the calling routine. the called function knows whether it is near or far and uses the appropriate return. so, in effect, the code you have now is probably using a far call to a routine which in turn is using a near return. A definite candidate for "undefined behavior", I would say, :) But, you say, this doesn't solve my problem! Well, how about this: make a far function in the same segment as the function you want which calls (near call) that function and then pass the pointer to this new far funtion to whatever needs it? client_function() far calls bridge_function() near calls desired_function() ----- Marshall Sutherland, Partner/Consultant, Digital Magic Computer Consulting dwatney@pine.circa.ufl.edu, dwatney@ufpine.bitnet Sysop, Farthinghale Arms BBS, (904) 378-4861