From owner-svn-src-head@FreeBSD.ORG Sat May 23 11:41:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59269106566C; Sat, 23 May 2009 11:41:31 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2A68FC20; Sat, 23 May 2009 11:41:30 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id A42A041C707; Sat, 23 May 2009 13:41:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 8T3T-iCYcaqu; Sat, 23 May 2009 13:41:27 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 597F541C71D; Sat, 23 May 2009 13:41:27 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id E65D74448E6; Sat, 23 May 2009 11:40:45 +0000 (UTC) Date: Sat, 23 May 2009 11:40:45 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Bruce Evans In-Reply-To: <20090523210556.Y826@delplex.bde.org> Message-ID: <20090523113511.N72053@maildrop.int.zabbadoz.net> References: <200905221810.n4MIAe4J014419@svn.freebsd.org> <20090522184846.GA34437@FreeBSD.org> <4A16F40B.4020404@freebsd.org> <20090523210556.Y826@delplex.bde.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sam Leffler , src-committers@FreeBSD.org Subject: Re: svn commit: r192591 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2009 11:41:32 -0000 > On Fri, 22 May 2009, Sam Leffler wrote: > >> I requested the printf identify the call site; e.g. >> >> printf("%s: out of clientids\n", __func__); > > That is equally cryptic _with_ grepping through the source code, and > much uglier. __func__ should only be used when the function name is > not a literal constant (mainly in macros). Even if I am going to regret this: I strongly say "NO" here. Using __func__ in printfs helps for a lot of things. Let me tell you the three that mostly annoyed me over the last months, constantly tripping over: - people move code from one function to another and do not update all the printfs. __func__ does that for you. - people copy and paste code and do not update the printfs and old function names, sometimes entirely unrelated, even in KASSERTs, stay. __func__ does not have that problem. - if I want to find function definitions and function calls using gre I do not want to find 47 printfs with the function name as well. __func__ does not show up in grep. I strongly vote for using __func__ in printfs! -- Bjoern A. Zeeb The greatest risk is not taking one.