Date: Fri, 9 Oct 2015 18:49:16 -0700 From: Mark Millard <markmi@dsl-only.net> To: Craig Rodrigues <rodrigc@crodrigues.org> Cc: FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org> Subject: Re: bt_split.c error: dereferencing type-punned pointer will break strict-aliasing rules (powerpc64-xtoolchain use) Message-ID: <D7C0D022-B756-44F0-9CB1-84952FE90064@dsl-only.net> In-Reply-To: <CAG=rPVe-wZp4VkxD9przXU3Dx69BhXvc6R3-U4oQxrWi%2B4-xjw@mail.gmail.com> References: <191CDC2D-7A74-41D2-B433-B6D9F6D87D32@dsl-only.net> <CAG=rPVe-wZp4VkxD9przXU3Dx69BhXvc6R3-U4oQxrWi%2B4-xjw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2015-Oct-9, at 4:58 PM, Craig Rodrigues <rodrigc@crodrigues.org> = wrote: > On Sun, Oct 4, 2015 at 4:06 AM, Mark Millard <markmi@dsl-only.net = <mailto:markmi@dsl-only.net>> wrote: >=20 > /usr/src/lib/libc/db/btree/bt_split.c:548:7: error: dereferencing = type-punned pointer will break strict-aliasing rules = [-Werror=3Dstrict-aliasing] > bt_preserve(t, *(pgno_t *)bl->bytes) =3D=3D RET_ERROR) >=20 > You will get many of these warnings all over the codebase. > You should add NO_WERROR=3D > to your make invocation, or put NO_WERROR=3D in make.conf. >=20 > That's what I do here: > = https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/631/consoleFull = <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/631/consoleFull= > Yes. Thanks for the reference to = FreeBSD_HEAD_amd64_gcc4.9/631/consoleFull . It is interesting to see. Type-punned pointer vs. strict-aliasing leaves me more worried about = source-code-assumption vs. code-generator-assumption mismatches. Many = warnings/errors are more like initialized-but-unused and various others = that I did not mention. Since powerpc64-xtoolchain and its powerpc64-gcc = are gcc5.2 based these days it might give more warnings/errors than = gcc4.9 or earlier. (I've not checked.) I switched to use NO_WERROR (and WERROR) after I sent in the note and = had looked at some of the other generated warnings/errors. =3D=3D=3D Mark Millard markmi at dsl-only.net On 2015-Oct-9, at 4:58 PM, Craig Rodrigues <rodrigc@crodrigues.org> = wrote: On Sun, Oct 4, 2015 at 4:06 AM, Mark Millard <markmi@dsl-only.net = <mailto:markmi@dsl-only.net>> wrote: /usr/src/lib/libc/db/btree/bt_split.c:548:7: error: dereferencing = type-punned pointer will break strict-aliasing rules = [-Werror=3Dstrict-aliasing] bt_preserve(t, *(pgno_t *)bl->bytes) =3D=3D RET_ERROR) You will get many of these warnings all over the codebase. You should add NO_WERROR=3D to your make invocation, or put NO_WERROR=3D in make.conf. That's what I do here: = https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/631/consoleFull = <https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/631/consoleFull= > -- Craig =20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D7C0D022-B756-44F0-9CB1-84952FE90064>