From owner-freebsd-arch@FreeBSD.ORG Thu Feb 7 21:51:26 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0CE02645 for ; Thu, 7 Feb 2013 21:51:26 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 90C0F12A for ; Thu, 7 Feb 2013 21:51:25 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 376947544; Thu, 07 Feb 2013 22:46:16 +0100 From: Hans Petter Selasky To: freebsd-arch@freebsd.org Subject: Re: Proposal: Unify printing the function name in panic messages() Date: Thu, 7 Feb 2013 22:47:26 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <51141E33.4080103@gmx.de> In-Reply-To: <51141E33.4080103@gmx.de> X-Face: ?p&W)c(+80hU; '{.$5K+zq{oC6y| /D'an*6mw>j'f:eBsex\Gi, Cc: Kirk McKusick , Christoph Mallon X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 21:51:26 -0000 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