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 080F018F0F for ; Wed, 12 Aug 2015 08:07:55 +0000 (UTC) Received: (qmail 90503 invoked by uid 500); 12 Aug 2015 08:07:54 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 90453 invoked by uid 500); 12 Aug 2015 08:07:54 -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 90438 invoked by uid 99); 12 Aug 2015 08:07:54 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2015 08:07:54 +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 04B5C1A9DC9 for ; Wed, 12 Aug 2015 08:07:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.121 X-Spam-Level: X-Spam-Status: No, score=-0.121 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=wandisco.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id gvYbXyC4-MhW for ; Wed, 12 Aug 2015 08:07:53 +0000 (UTC) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id BB599428F6 for ; Wed, 12 Aug 2015 08:07:52 +0000 (UTC) Received: by wibhh20 with SMTP id hh20so16737504wib.0 for ; Wed, 12 Aug 2015 01:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wandisco.com; s=gapps; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=PiSWlo5UEwaEJcgs3iejz9th4NkBj5tQTxSAkblG4eY=; b=NHwPbXXG5glsxMemmGTry4lTtrKATAPdF6eIt202Ar3FeD2R06o8K10UHur/ZAddXI JMNyCqN1o2OBUTMlMQQgUFxLLP2ANXd9JuDMm/h+POj5w+p/ZdQPbiSxVn91JE+M0yZw WKuocNmTHZIT3YLiqa7KdvWutga49tkr9814U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=PiSWlo5UEwaEJcgs3iejz9th4NkBj5tQTxSAkblG4eY=; b=bEzWSaY45YuMtrX6Gvm6Lgv+2W79satHS+zHpJ2ErAcKakAuhcK8+QxtB18tHSAp1O 858iTB8GJsdd2AoTnEvqJAWuROhbwtrC1QWXHINzdpepeQK44fwZ+mVWbL1Cmb9BHIoI dw5IYeFxhKVjQ+rZGUuedNIMRPUWvQrtf5fZPFd7sfgRgdlbsRvDiQP8nFUE+4UTnFVf mw4YtCnKwtceXI0aHvQ2S8ulGcBD81QuQmsqbGQFTY0Nme2HjGNjFJh6XADhgfi/BB+h 2c7pEDxLqyxZQbLHIEXhy/Z3rI9jC6OuxvRVFEob/8Zs1SsLlixhWTapc5ixgUFVBRbB 1xrA== X-Gm-Message-State: ALoCoQk0aCyuZOIZi0Q+VSxi6j9rGXJgq7PYq8A23lNckFnlTVCzsdsgnV67kaxieh83N9C41JyM X-Received: by 10.180.97.134 with SMTP id ea6mr45900272wib.63.1439366871885; Wed, 12 Aug 2015 01:07:51 -0700 (PDT) Received: from zulu.23.e-reka.si (cpe-90-157-247-142.dynamic.amis.net. [90.157.247.142]) by smtp.gmail.com with ESMTPSA id ck18sm6641469wjb.47.2015.08.12.01.07.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Aug 2015 01:07:51 -0700 (PDT) Received: from zulu.23.e-reka.si (localhost [127.0.0.1]) by zulu.23.e-reka.si (Postfix) with ESMTP id 63C4EF4CEC4E for ; Wed, 12 Aug 2015 10:07:49 +0200 (CEST) Message-ID: <55CAFED5.4030109@wandisco.com> Date: Wed, 12 Aug 2015 10:07:49 +0200 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= Organization: WANdisco User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: dev@subversion.apache.org Subject: Re: Review of sizeof usage References: <87pp2tvpfc.fsf@wandisco.com> <55CA5344.8090005@wandisco.com> <20150811223111.GH1859@tarsus.local2> In-Reply-To: <20150811223111.GH1859@tarsus.local2> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 12.08.2015 00:31, Daniel Shahaf wrote: > >>> We have had problems with both styles in the past, so neither is immune >>> to bugs. I prefer the explicit type as it is easier to grep. >> The explicit type form is more accident-prone than the variable form >> because any change requires two modifications in the same statement >> instead of one. > Why doesn't the compiler or buildbot catch accidents? I can't imagine a way for the compiler to emit warnings for such constructs without getting a far too large percentage of false positives. It's perfectly valid, and in many cases required by some object-like architecture, to allocate a buffer that has a different size than the one implied by the pointer that stores the return value. This is C, after all. -- Brane