Path: utzoo!mnetor!uunet!husc6!im4u!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!bzs From: bzs@bu-cs.BU.EDU (Barry Shein) Newsgroups: comp.unix.wizards Subject: Re: sun-3 dbx, arguments, hacking, help... Message-ID: <22037@bu-cs.BU.EDU> Date: 25 Apr 88 23:39:11 GMT References: <1641@homxb.UUCP> Organization: Boston U. Comp. Sci. Lines: 19 In-reply-to: dean@homxb.UUCP's message of 24 Apr 88 17:50:39 GMT This "magic function that returns the number of args" started a long time ago with the unix function nargs() which did the same basic thing. You will now, undoubtedly, get all sorts of sneers from people who like playing armchair quarterback about how you shouldn't do that (even tho you explained that you inherited it!) One idea that comes to mind is to use /usr/5bin/m4 on the Sun (the other BSD/Pre-SysV m4 won't do this) to massage the calls into a format where the first arg will be the number of arguments, then you can work that one function to use varargs.h : define(do_something,Do_something(`$#',$*)) (the quotes are necessary) with a little cleverness you could batch-run that once on all your files. I ain't sayin it's a sure fix, but it might get you thinking about solving that once and for all. -Barry Shein, Boston University