Subject: Re: kernel panic messages
To: None <,>
From: M. Warner Losh <>
List: tech-kern
Date: 05/07/2003 10:27:37
In message: <>
            "Greg A. Woods" <> writes:
: [ On Sunday, May 4, 2003 at 06:35:17 (-0600), M. Warner Losh wrote: ]
: > Subject: Re: kernel panic messages
: >
: > There's a standard way to do this that doesn't depend on gccisms.
: > That's iso-99 not iso-89, however.
: > 
: > #define panic(...) _panic(__FILE__, __LINE__, __VA_ARGS__);
: I think there's a normal C way to do it too of course, if you allow for
: a two-step procedure...
: 	#define panic(varags)	{ _panic_setup(__FILE__, __LINE__); _panic varargs; }
: where all calls are simply modified to have an extra set of parentheses
: around their parameters:
: 	panic(("help! %s", message));

That's the 'old school' way of doing it.  C99 defines what I wrote
above, and it doesn't require changes to all uses of panic in the
kernel.  I'm very aware of the technique and think it is so utterly
bletcherous that I don't even want to acknowledge it as an alternative.