Date: Sat, 18 Jul 2015 08:26:31 +1000 From: Peter Jeremy <peter@rulingia.com> To: "Pedro F. Giffuni" <pfg@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285644 - head/contrib/sqlite3 Message-ID: <20150717222631.GD36150@server.rulingia.com> In-Reply-To: <201507162207.t6GM7ECT009955@repo.freebsd.org> References: <201507162207.t6GM7ECT009955@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2015-Jul-16 22:07:14 +0000, "Pedro F. Giffuni" <pfg@FreeBSD.org> wrote: >Log: =2E.. > sqlite: clean a couple of invocations of memcpy(3) > =20 > Found almost accidentally by our native gcc when enhanced with > FORTIFY_SOURCE. =2E.. >- 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. '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. --=20 Peter Jeremy --wq9mPyueHGvFACwf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJVqYEXXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs0nqAP/12Q9SIhp5lQEe5cdqK5jhOA f/sgMX7KfWlovU+DTYxzbrIUrq6GHFpFNIm0OJFCyvbd6YG84CC66Eg+Vn1k8YFg 1zCqKyRP9Di1J//23yffP5LQeMGJXB0SfGWLSx9UYvQhcB8tDmAly4/aGTK2l+0m 36xTsGQnpfQi8XJGDfFpYmSYSXtJ/cirbRoCRE8QbfC+Bwzr+GXwFeTBkT6ZKRNk uLx9dbH3HJiChM16gnk7vE6fcbmUUNbdHms07+E2f6Suv4aU0WPHWnEBxGnPkfX5 q5OtH1fPqkcJWtq4zIa3TXH1zb+jV/+uGElYIRsIXqbnVEh65U9y5LlztTqD+no+ 4U1kVr0KCqITYg7oIVSbE++drAqPQgz31aZ1BSm4GabUQbS83F5pduZ1BnUDotHi 2psnqgMuh/Nhab3wM545Q0ENtxeDojlachc8DpTtabMX1xOLdiuV/TeYvj9Bp3yw 7j7DakUgbCJIvkdLmkjehViVmaX0TVQwPYlWBpXlKZnTcW2ahFXbzzGZlp4oS1hz smZjDawt52oKN3hNSQj05IibbGC7JuY1mH+SIJhtsSZD47ZjtPmMZwiArzvlzcuT /p+wqEl2RRAr3EGSNU9huwXRvgvxdA6Nad8ovvhZGsBGyI29tgAF2XNZMJXSqR2J /Or/T2gdUlpgyy1mWXK2 =aPzA -----END PGP SIGNATURE----- --wq9mPyueHGvFACwf--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150717222631.GD36150>