Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!blars!blarson From: blarson@blars Newsgroups: comp.os.os9 Subject: Re: OSK C Compiler problem with No. of Args Keywords: OSK, C Message-ID: <195@blars> Date: 26 Apr 91 08:21:21 GMT References: <1991Apr25.174038.7834@cbnewsd.att.com> Sender: news@usc Reply-To: blarson@usc.edu Lines: 40 Nntp-Posting-Host: dianne.usc.edu Originator: blarson@dianne.usc.edu In article <1991Apr25.174038.7834@cbnewsd.att.com> knudsen@cbnewsd.att.com (michael.j.knudsen) writes: >This isn't a bug (maybe) Definatly not a bug. >If one of your functions is defined as taking N arguments, >then your calls to that function had better have exactly N arguments, >no less! (Maybe more is OK; not tried). More is definatly OK, and if you want to do a variable number I strongly recomend my varargs.h. (Smilodon.cs.wisc.edu has at least two copies: mg and blarslib both contain it. Let me know if it should be uploaded separatly.) >But OSK C does strange things sometimes if not all args are present. >I know it puts the first two args in regs d0 and d1, then pushes >the rest on stack, in [I hope] reverse order. The register use gets more complicated if you ever use floating point. You realy shouldn't care what order things are pushed in unless you are writing a varargs.h or stdarg.h package, which should be included with the C compiler so only the compiler author needs to worry about it. (Stdarg.h can't be done without compiler support on OSK.) >Anyway, just another sloppy programming practice that you can't get >away with any more. Any more??? Useing this sloppy programming practice was taking advantage of a compier bug, (that it didn't diagnose the condition) and never should have been counted on. -- blarson@usc.edu C news and rn for os9/68k! -- Bob Larson (blars) blarson@usc.edu usc!blarson Hiding differences does not make them go away. Accepting differences makes them unimportant.