Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!spdcc!xylogics!transfer!lectroid!jjmhome!cpoint!steve From: steve@cpoint.UUCP (Stephen Steir) Newsgroups: comp.sys.amiga.tech Subject: Re: YAMB (Yet Another Manx Bug in 5.0a) Message-ID: <4631@cpoint.UUCP> Date: 12 Apr 90 18:59:12 GMT References: <16544@estelle.udel.EDU> <738@cameron.cs.duke.edu> Reply-To: steve@cpoint.UUCP (Stephen Steir) Organization: Clearpoint Research Corp., Hopkinton Mass. Lines: 28 In article <738@cameron.cs.duke.edu> amr@dukee.egr.duke.edu (Anthony M. Richardson) writes: >From article <16544@estelle.udel.EDU>, by new@udel.EDU (Darren New): >> In article <4606@cpoint.UUCP> steve@cpoint.UUCP (Stephen Steir) writes: >>>I post this example in hopes that it will save time for other Manx 5.0a users. >>> int (*p2foo)(); >> Maybe you should try int (*p2foo)(short, short, short); >> This works for me in LC5.04 and I get warnings if I don't put the >> arguments in. I suspect this is not really a bug. -- Darren > >I agree, I don't think it is a bug either. Since (*p2foo) is not >prototyped how can the compiler possibly know how to cast the >arguments? And, since in the original post, (*p2foo) was not >prototyped, I think the compiler correctly cast its arguments as longs. It is impossible to predict an argument prototype for a pointer to a function. 'C' compilers have always pushed a short argument as a short and the only advantage of a function prototype is to warn the programer of mismatched types. If shorts get pushed as longs, how would you expect printf to work? Further, how would you prototype printf? The example doesn't show it, but I did try casting the arguments to shorts before they were pushed which also didn't work. ------------------------------------------------------------------------------ Steve Steir - Clearpoint Research Corp., 35 Parkwood Dr., Hopkinton, Ma. 01748 UUCP: steve@frog!cpoint ATT: (508) 435-2000 BIX: clearpoint ------------------------------------------------------------------------------