Date: Mon, 3 Jul 2023 20:07:50 -0400 From: Ka Ho Ng <khng300@gmail.com> To: Brooks Davis <brooks@freebsd.org> Cc: Ka Ho Ng <khng@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 005aa1743b42 - main - modules: bzero the modspecific_t Message-ID: <CANnchUbpf%2BnY%2BFTUxFNACJZpgoNbEAU8FZHF4g5gi%2Bnqxm4i7w@mail.gmail.com> In-Reply-To: <ZKM8e7cdDsKuIbRf@spindle.one-eyed-alien.net> References: <202307012259.361MxM4i017090@gitrepo.freebsd.org> <ZKM8e7cdDsKuIbRf@spindle.one-eyed-alien.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000008d3efd05ff9e1329 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 3, 2023, 17:24 Brooks Davis <brooks@freebsd.org> wrote: > On Sat, Jul 01, 2023 at 10:59:22PM +0000, Ka Ho Ng wrote: > > The branch main has been updated by khng: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=005aa1743b42b52fbd49b9d5ec44816902b6ee9f > > > > commit 005aa1743b42b52fbd49b9d5ec44816902b6ee9f > > Author: Ka Ho Ng <khng@FreeBSD.org> > > AuthorDate: 2023-07-01 19:41:53 +0000 > > Commit: Ka Ho Ng <khng@FreeBSD.org> > > CommitDate: 2023-07-01 22:58:46 +0000 > > > > modules: bzero the modspecific_t > > > > Per https://reviews.llvm.org/D68115, only the first field is > > zero-initialized, meanwhile other fields are undef. > > > > The pattern can be observed on clang as well, that when > > -ftrivial-auto-var-init=pattern is specified 0xaa is filled for > > non-active fields, otherwise they are zero-initialized. > > Technically both are acceptable when using clang. However it > > would be good to simply bzero the modspecific_t in such case to > > be strict to the standard. > > IMO this is a move in the wrong direction. We should see about > switching this file to C17 which IIRC removes this bug in the standard. > > Ideally we'd be moving to C23 where we can just do foo = {} > to zero things, but we've got a ways to go... > That seems like a good idea. Ka Ho --0000000000008d3efd05ff9e1329 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D= "gmail_attr">On Mon, Jul 3, 2023, 17:24 Brooks Davis <<a href=3D"mailto:= brooks@freebsd.org">brooks@freebsd.org</a>> wrote:<br></div><blockquote = class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid= ;padding-left:1ex">On Sat, Jul 01, 2023 at 10:59:22PM +0000, Ka Ho Ng wrote= :<br> > The branch main has been updated by khng:<br> > <br> > URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D005aa1743b42= b52fbd49b9d5ec44816902b6ee9f" rel=3D"noreferrer noreferrer" target=3D"_blan= k">https://cgit.FreeBSD.org/src/commit/?id=3D005aa1743b42b52fbd49b9d5ec4481= 6902b6ee9f</a><br> > <br> > commit 005aa1743b42b52fbd49b9d5ec44816902b6ee9f<br> > Author:=C2=A0 =C2=A0 =C2=A0Ka Ho Ng <khng@FreeBSD.org><br> > AuthorDate: 2023-07-01 19:41:53 +0000<br> > Commit:=C2=A0 =C2=A0 =C2=A0Ka Ho Ng <khng@FreeBSD.org><br> > CommitDate: 2023-07-01 22:58:46 +0000<br> > <br> >=C2=A0 =C2=A0 =C2=A0modules: bzero the modspecific_t<br> >=C2=A0 =C2=A0 =C2=A0<br> >=C2=A0 =C2=A0 =C2=A0Per <a href=3D"https://reviews.llvm.org/D68115" rel= =3D"noreferrer noreferrer" target=3D"_blank">https://reviews.llvm.org/D6811= 5</a>, only the first field is<br> >=C2=A0 =C2=A0 =C2=A0zero-initialized, meanwhile other fields are undef.= <br> >=C2=A0 =C2=A0 =C2=A0<br> >=C2=A0 =C2=A0 =C2=A0The pattern can be observed on clang as well, that = when<br> >=C2=A0 =C2=A0 =C2=A0-ftrivial-auto-var-init=3Dpattern is specified 0xaa= is filled for<br> >=C2=A0 =C2=A0 =C2=A0non-active fields, otherwise they are zero-initiali= zed.<br> >=C2=A0 =C2=A0 =C2=A0Technically both are acceptable when using clang. H= owever it<br> >=C2=A0 =C2=A0 =C2=A0would be good to simply bzero the modspecific_t in = such case to<br> >=C2=A0 =C2=A0 =C2=A0be strict to the standard.<br> <br> IMO this is a move in the wrong direction.=C2=A0 We should see about<br> switching this file to C17 which IIRC removes this bug in the standard.<br> <br> Ideally we'd be moving to C23 where we can just do foo =3D {}<br> to zero things, but we've got a ways to go...<br></blockquote></div></d= iv><div dir=3D"auto">That seems like a good idea.</div><div dir=3D"auto"><b= r></div><div dir=3D"auto">Ka Ho</div></div> --0000000000008d3efd05ff9e1329--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANnchUbpf%2BnY%2BFTUxFNACJZpgoNbEAU8FZHF4g5gi%2Bnqxm4i7w>