From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuKgu-0005Sd-MJ for qemu-devel@nongnu.org; Thu, 05 Nov 2015 08:35:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuKgp-00088l-N2 for qemu-devel@nongnu.org; Thu, 05 Nov 2015 08:35:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuKgp-00088e-I7 for qemu-devel@nongnu.org; Thu, 05 Nov 2015 08:34:55 -0500 References: <1446586842-21793-1-git-send-email-somlo@cmu.edu> <1446586842-21793-6-git-send-email-somlo@cmu.edu> <563A1E69.40602@redhat.com> <20151104163505.GA4505@HEDWIG.INI.CMU.EDU> <563B4A33.7000708@redhat.com> <874mh0wqn5.fsf@blackfin.pond.sub.org> From: Laszlo Ersek Message-ID: <563B5AFB.5050005@redhat.com> Date: Thu, 5 Nov 2015 14:34:51 +0100 MIME-Version: 1.0 In-Reply-To: <874mh0wqn5.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 5/6] fw_cfg: add generic non-DMA read method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: peter.maydell@linaro.org, jordan.l.justen@intel.com, "Gabriel L. Somlo" , qemu-devel@nongnu.org, kraxel@redhat.com, pbonzini@redhat.com, markmb@redhat.com On 11/05/15 13:57, Markus Armbruster wrote: > Laszlo Ersek writes: > >> On 11/04/15 17:35, Gabriel L. Somlo wrote: > [...] >>> + assert(size > 0 && size <= sizeof(value)); >> >> It's a matter of taste, and I won't insist at all, just mention that I >> didn't write those two assert()s as separate statements :) >> >> Namely, with a conjunction (P1 && P2 && ... && Pn), you have the >> possibility to spell the assertion as: >> >> assert(P1); >> assert(P2); >> ... >> assert(Pn); >> >> And, if any one of those fails, you will know *which one*. Because the >> line number in the "assertion failed" message will tell you. > > Yes, matter of taste, but that can't stop me having opinions on matters > of taste ;) > > You pay for the more detailed assertion failure reporting with extra > source code clutter (as written, it's immediately obvious that it's a > bounds check, less so if split), and extra object code when NDEBUG is > off (which it should always be). > > Personally, I'm content to fish details out of a core dump. YMMV. The 12 GB core dump that the Launchpad user, reporting the bug from the other side of the Earth, failed to save? :) But, I do concede your point. (Line numbers aren't a panacea either, in situations like the above.) Gabriel, please pick whichever format you like more. Thanks Laszlo