Proposal: Unify printing the function name in panic messages()

Hans Petter Selasky hselasky at c2i.net
Thu Feb 7 21:51:26 UTC 2013


On Thursday 07 February 2013 22:35:47 Christoph Mallon wrote:
> Hi,
> 

Hi,

> /*
>  * Panic and automatically prepend the name of the function to the panic
>  * message.  If NAMED_PANIC is not set, the name is omitted.
>  */
> #ifdef NAMED_PANIC
> #	define PANIC(fmt, ...) panic("%s: " fmt, __func__, ##__VA_ARGS__)
> #else
> #	define PANIC(fmt) panic(__VA_ARGS__)
> #endif
> 

You mean:

#define PANIC(...) panic(__VA_ARGS__)

> 
> Do you have suggestions to improve this proposal?

Why not make two variants to avoid the #ifdef ?

PANIC_NAMED(fmt, ...)

and

PANIC(...)

--HPS


More information about the freebsd-arch mailing list