Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!bu.edu!bucsf.bu.edu!jdubb From: jdubb@bucsf.bu.edu (jay dubb) Newsgroups: comp.lang.c Subject: adding automatic arguments to variable-number parameter functions Message-ID: <71769@bu.edu.bu.edu> Date: 8 Jan 91 03:28:24 GMT Sender: news@bu.edu.bu.edu Distribution: usa Organization: Computer Science Department, Boston University, Boston, MA, USA Lines: 21 Originator: jdubb@bucsf.bu.edu I am posting this for a friend of mine who does not have USENET access, so please reply directly to mlevin@jade.tufts.edu. I have sort of an odd question, about who you would do the following in C. I have a rather large program, which uses a function called check_error() to check various things (errno, etc.) to make sure everything is fine. To enable me to know where the error actually happenned, I have the following macro: #define check_problem() check_error(__LINE__,__FILE__), and in my code, I just say "check_problem()" and it automatically gets filled in with the right line and file, so I know where exactly it was called from when the error was found. Now, I would like to do the same sort of thing, but to a function which uses the facility which lets it be called with a variable number of arguments (like printf does). Is there any way to do that, or will the macro pre-processor get too confused? Thanks! Mike Levin mlevin@jade.tufts.edu