From owner-svn-src-all@freebsd.org Thu Jul 16 22:34:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9383E9A464F for ; Thu, 16 Jul 2015 22:34:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm49-vm10.bullet.mail.bf1.yahoo.com (nm49-vm10.bullet.mail.bf1.yahoo.com [216.109.114.251]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2912F1EB3 for ; Thu, 16 Jul 2015 22:34:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1437085731; bh=qrs40LVOVHvI0xOkZneDM88eXi93rYBen6+E384tYMA=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=TfR+LcKS6/K74XhXO+tYGklkAGMo0tqFFS3mw29z1nHoq2R81iCrFaR1tqkeCm33Glb1JaOp8Jg8LiNgq6l18g98DfHcs/c2DhDw1Cy6AhkaKIgWxRyRrRc/knELattZqqW7i90Ymf6DXAnvpy0ed8LTvp5JVnL+7lCPE9fFHPi+1uLymLiglmzFcvDH5kXqwd6UJp8uci5cfkZxsdNNE6FomDd2Fc1qTAsryqM+dhAo57NB5ROptVgjN3vvWx/TJNciO3HGOyHq644cEtdd57dXEfPFBj75mmvT43bo+u1l10/A5bk+e2d/lOle9r6dJV6eQAZrA0ovpZVmA9PFFw== Received: from [66.196.81.170] by nm49.bullet.mail.bf1.yahoo.com with NNFMP; 16 Jul 2015 22:28:51 -0000 Received: from [98.139.213.13] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 16 Jul 2015 22:28:51 -0000 Received: from [127.0.0.1] by smtp113.mail.bf1.yahoo.com with NNFMP; 16 Jul 2015 22:28:51 -0000 X-Yahoo-Newman-Id: 321210.91040.bm@smtp113.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Qj8noOQVM1mVuvbr.FBPu0lVHU.Hq09NVy4DhiWE8IEVhtO UdW8N2S54tXElj3i0Jv3BbPIY1hDdbnPYL8iK3jTOLTSmiaOnGdMy4FBnu1p dtkcXdLghIahilUsFI7Chr.e5tZ8F919U8_RK5XnX7lLVj341_L95M.w5qQN oTI76HDhkMmGB9_ou2cuckzlEICxr0H0G8TTQZHbtsiHszPkKQCYr70JGsha g1WltUhx_4YQi87lqbjDDgwMHonqJUtKr3AE_kCGOmZIpnKbC00sMKErieK6 ZAVB85FC4CMCn0owvy6QE2_pUiAQneJCn9YOG_grbC49CBFXXwG9vCd_wLoK mam0edQ70uqGGF9hJgZG39EzCI.ZrglwCW_0yJWcSM2gGvccLGc.UCqaIP3V PXVJQb5byZgB9.MhfnfsiB8IE7Qe_qCi4T7dRs7esdw8pkn2VAeGnKz.NLCI VA9pbXEf3Ld_tIFN4aGBoPtHtJwFl5Vf7J5iKEAvrNMc47UcDLMIWCuKRmAG R3.VuedFmrGIyLeqlN.mWv6oULpg_0dXm X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55A830E4.6090408@FreeBSD.org> Date: Thu, 16 Jul 2015 17:32:04 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ian Lepore CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285644 - head/contrib/sqlite3 References: <201507162207.t6GM7ECT009955@repo.freebsd.org> <1437085366.1334.367.camel@freebsd.org> In-Reply-To: <1437085366.1334.367.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2015 22:34:48 -0000 On 07/16/15 17:22, Ian Lepore wrote: > On Thu, 2015-07-16 at 22:07 +0000, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Thu Jul 16 22:07:13 2015 >> New Revision: 285644 >> URL: https://svnweb.freebsd.org/changeset/base/285644 >> >> Log: >> sqlite: clean a couple of invocations of memcpy(3) >> >> Found almost accidentally by our native gcc when enhanced with >> FORTIFY_SOURCE. >> >> Submitted by: Oliver Pinter >> Sponosored by: Google Inc. GSoC 2015 >> >> Modified: >> head/contrib/sqlite3/sqlite3.c >> >> Modified: head/contrib/sqlite3/sqlite3.c >> ============================================================================== >> --- head/contrib/sqlite3/sqlite3.c Thu Jul 16 19:40:18 2015 (r285643) >> +++ head/contrib/sqlite3/sqlite3.c Thu Jul 16 22:07:13 2015 (r285644) >> @@ -49487,9 +49487,9 @@ static void walIndexWriteHdr(Wal *pWal){ >> pWal->hdr.isInit = 1; >> pWal->hdr.iVersion = WALINDEX_MAX_VERSION; >> walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum); >> - memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr)); >> + memcpy((void *)&aHdr[1], (const void *)&pWal->hdr, sizeof(WalIndexHdr)); >> walShmBarrier(pWal); >> - memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr)); >> + memcpy((void *)&aHdr[0], (const void *)&pWal->hdr, sizeof(WalIndexHdr)); >> } >> >> /* >> > Setting aside any "unnecessary divergence with upstream" questions for > the moment, wouldn't the correct fix be to just remove the casting > completely? The compiler should know, but it is not wrong to have the casts match the (standard) implementation. I couldn't say which is "more" correct. Pedro.