From owner-svn-src-all@freebsd.org Fri Jul 17 22:53:09 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 4C9F59A4199 for ; Fri, 17 Jul 2015 22:53:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm48.bullet.mail.bf1.yahoo.com (nm48.bullet.mail.bf1.yahoo.com [216.109.114.64]) (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 E7772159E for ; Fri, 17 Jul 2015 22:53:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1437173581; bh=I+BCKTFfZMq0Kp1wRFZqAiMbQxnsSQvj7TSmpavKupw=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=FhpqPGsB4mFIx0tNYHM4qFqllOG+1s+ak6Y9fQakQLUFObfLgf+kP6n+uv2ZswN4DyQmBW8p2bQuUnYVt9JTITVskX7ZqArjs4JXNVOiYeSPysmprsAdHMfNL6UqcsxKHvq6HwiL3Cs3e0qEmd1MOC7vuvuRkpk/wmfwtaRTYkQtmxDh59sPhjczuKa8Dkh0Q1pM8VA0UM9qZQupFYjgZdyo8umxSNkxOq+hp1o4/shOR985r3qT8xm0XJcBbXWbY3nOeRiTsWV+EfsIWDeVBx6KA+D0QXnao5ggASMelRAbxy2QhNy66aHm+EX1wmMGKlKUQTNZqJ2LP+SVnoBckw== Received: from [98.139.170.179] by nm48.bullet.mail.bf1.yahoo.com with NNFMP; 17 Jul 2015 22:53:01 -0000 Received: from [98.139.211.197] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 17 Jul 2015 22:53:01 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 17 Jul 2015 22:53:01 -0000 X-Yahoo-Newman-Id: 440407.96290.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: j9t0y6sVM1mZa4bAmxdbIMzRXlTIeeoCbJThvEBXTQfWMJP HV1AzPhqd9j5ThsyOvgU4y3SINcPE1XXXrt2q72R.y3fn_EVatSMtGC5NoFb lJHphmyca6yNb9lZJMKQrhIHORNhLo_tL794fvnCzUd6Uh5u54H_HBdfmB6K 6i2Wun4_yjvydyJsknpXrn.ApsHouW3QFanWoKrAtWBovYN63kK.6HvAiCKo 6IIApjcJb2oWH3eAOV7.lLZbe.N35jjE0rgGSI2ppc9mJU89rqcZ6NCP32UY 41lErgJT4b5O.OK0pd4uQkC9l7cXmNjdBpPjkUvINeYTcamdnvKPXCXvOyef PUZhXjs1hAAA6OGsRqyOMR015dHstTuPsVrwjAX.UiN3pkBDwl3HKkQAJHH2 BfVPzxpRyEeGyK8utYDAb_uPaQ11xuWeDgtO78hSgCZjBfG5mxqtC5ioe7ZA VipWvBUyUH1jxKwHfARavoyLSruMNf3Skc84SuanxIqEoAcT3CJW3d2n.jyy 5zo5OLe_Y.d2Pnp5jbJhbdhIRoLpdt2.H X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <55A98763.1030705@FreeBSD.org> Date: Fri, 17 Jul 2015 17:53:23 -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: Peter Jeremy 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> <20150717222631.GD36150@server.rulingia.com> In-Reply-To: <20150717222631.GD36150@server.rulingia.com> 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: Fri, 17 Jul 2015 22:53:09 -0000 On 07/17/15 17:26, Peter Jeremy wrote: > On 2015-Jul-16 22:07:14 +0000, "Pedro F. Giffuni" wrote: >> Log: > ... >> sqlite: clean a couple of invocations of memcpy(3) >> >> Found almost accidentally by our native gcc when enhanced with >> FORTIFY_SOURCE. > ... >> - 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)); > If the compiler complained about that, the compiler is broken. The change was rather collateral (read cosmetical) to the real warning which remains unfixed. The compiler warning is this: ... ===> lib/libsqlite3 (obj,depend,all,install) cc1: warnings being treated as errors /scratch/tmp/pfg/head/lib/libsqlite3/../../contrib/sqlite3/sqlite3.c: In function 'walIndexWriteHdr': /scratch/tmp/pfg/head/lib/libsqlite3/../../contrib/sqlite3/sqlite3.c:49490: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type /scratch/tmp/pfg/head/lib/libsqlite3/../../contrib/sqlite3/sqlite3.c:49492: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type --- sqlite3.So --- *** [sqlite3.So] Error code 1 ... make[6]: stopped in /scratch/tmp/pfg/head/lib/libsqlite3 It only happens when using the experimental FORTIFY_SOURCE support [1], and it only happens with gcc (the base one is the only tested). Yes, I am suspecting a compiler bug but gcc has been really useful to find bugs in fortify_source. > 'const' > is a promise to the caller that the given parameter will not be modified > by the callee. There's no requirement that the passed argument be const. > As bde commented, the casts are all spurious. And since this is contrib'ed code I am not going through the code churn but upstream has been notified. Pedro. [1] https://reviews.freebsd.org/D3043