Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F2AB18C4D for ; Thu, 13 Aug 2015 18:20:35 +0000 (UTC) Received: (qmail 29184 invoked by uid 500); 13 Aug 2015 18:20:28 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 29133 invoked by uid 500); 13 Aug 2015 18:20:28 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 29113 invoked by uid 99); 13 Aug 2015 18:20:28 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2015 18:20:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 21F641AA072 for ; Thu, 13 Aug 2015 18:20:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=btopenworld.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 73n-blAMUk6y for ; Thu, 13 Aug 2015 18:20:13 +0000 (UTC) Received: from rgout06.bt.lon5.cpcloud.co.uk (rgout06.bt.lon5.cpcloud.co.uk [65.20.0.183]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id F269434CA9 for ; Thu, 13 Aug 2015 16:13:30 +0000 (UTC) X-OWM-Source-IP: 209.85.212.170(US) X-OWM-Env-Sender: julianfoad@btinternet.com X-CTCH-RefID: str=0001.0A090202.55CCC224.00E1,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-Junkmail-Premium-Raw: score=8/50,refid=2.7.2:2015.7.31.105415:17:8.317,ip=209.85.212.170,rules=__PHISH_SPEAR_HTTP_RECEIVED, __YOUTUBE_RCVD, __MIME_VERSION, __IN_REP_TO, __REFERENCES, __HAS_FROM, __HAS_MSGID, __SANE_MSGID, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __TO_MALFORMED_2, __MULTIPLE_RCPTS_CC_X2, __CT, __CT_TEXT_PLAIN, CT_TEXT_PLAIN_UTF8_CAPS, __HELO_GMAIL, __SUBJ_ALPHA_NEGATE, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_800_899, __MIME_TEXT_ONLY, __RDNS_GMAIL, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, WEBMAIL_SOURCE, MULTIPLE_RCPTS, __PHISH_SPEAR_STRUCTURE_1, BODY_SIZE_1000_LESS, BODY_SIZE_2000_LESS, __PHISH_SPEAR_STRUCTURE_2, BODY_SIZE_7000_LESS, NO_URI_FOUND, REFERENCES, NO_URI_HTTPS, __DQ_NEG_IP, __DQ_NEG_HEUR X-CTCH-Spam: Unknown Received: from mail-wi0-f170.google.com (209.85.212.170) by rgout06.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as julianfoad@btopenworld.com) id 55B9007601A83875 for dev@subversion.apache.org; Thu, 13 Aug 2015 17:13:24 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btopenworld.com; s=btcpcloud; t=1439482411; bh=9JpCEeVMuIt5GH8R2loVUFHpYlVDBfrmg1kwDPXZBkA=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc; b=W+9iv2fYX1ulqGIFry6bvpgeUalSc3UbyWecNflxvaPH9R26aSsKdYU3WeUDJ30bZND39452XbZZgGthhiQHNIvL5ioPrSBsfsXReGaQbA3D/XA1ViNvpFtvyyCRxAEzKbt+UMCDbYMdrfEindd9nezPiv2X6wHrlvF/HQ6sL08= Received: by wicja10 with SMTP id ja10so76073519wic.1 for ; Thu, 13 Aug 2015 09:12:45 -0700 (PDT) X-Received: by 10.180.78.136 with SMTP id b8mr7440367wix.89.1439480683494; Thu, 13 Aug 2015 08:44:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.33.230 with HTTP; Thu, 13 Aug 2015 08:44:24 -0700 (PDT) In-Reply-To: References: <87pp2tvpfc.fsf@wandisco.com> <87oaibcx17.fsf@wandisco.com> From: Julian Foad Date: Thu, 13 Aug 2015 16:44:24 +0100 Message-ID: Subject: Re: Review of sizeof usage To: Stefan Fuhrmann Cc: Philip Martin , Subversion Development Content-Type: text/plain; charset=UTF-8 FWIW, I too have come to prefer the variable-based form, for readability reasons. One reason is that it is easier to quickly recognize and verify the idiom when the redundancy is in the form of two identical names close together: svn_my_type_t *my_var; [...] foo(my_var, sizeof(*my_var)); <== 'my_var' twice than when the nearby pairing uses two different names and the repetition of the type name is widely separated: svn_my_type_t *my_var; [...] foo(my_var, sizeof(svn_my_type_t)); especially when the declaration was separate from the statement that uses it. Another reason is that the variable name is usually shorter, the entire statement often fitting on one line, whereas the type name is usually a public, user-defined type (or pointer to such) with a longer name. - Julian