[comp.lang.c] adding automatic arguments to variable-number parameter functions

jdubb@bucsf.bu.edu (jay dubb) (01/08/91)

   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