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
[-- Attachment #1 --] 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 [-- Attachment #2 --] <div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 3, 2023, 17:24 Brooks Davis <<a href="mailto:brooks@freebsd.org">brooks@freebsd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="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="https://cgit.FreeBSD.org/src/commit/?id=005aa1743b42b52fbd49b9d5ec44816902b6ee9f" rel="noreferrer noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=005aa1743b42b52fbd49b9d5ec44816902b6ee9f</a><br> > <br> > commit 005aa1743b42b52fbd49b9d5ec44816902b6ee9f<br> > Author: Ka Ho Ng <khng@FreeBSD.org><br> > AuthorDate: 2023-07-01 19:41:53 +0000<br> > Commit: Ka Ho Ng <khng@FreeBSD.org><br> > CommitDate: 2023-07-01 22:58:46 +0000<br> > <br> > modules: bzero the modspecific_t<br> > <br> > Per <a href="https://reviews.llvm.org/D68115" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/D68115</a>, only the first field is<br> > zero-initialized, meanwhile other fields are undef.<br> > <br> > The pattern can be observed on clang as well, that when<br> > -ftrivial-auto-var-init=pattern is specified 0xaa is filled for<br> > non-active fields, otherwise they are zero-initialized.<br> > Technically both are acceptable when using clang. However it<br> > would be good to simply bzero the modspecific_t in such case to<br> > be strict to the standard.<br> <br> IMO this is a move in the wrong direction. 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 = {}<br> to zero things, but we've got a ways to go...<br></blockquote></div></div><div dir="auto">That seems like a good idea.</div><div dir="auto"><br></div><div dir="auto">Ka Ho</div></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANnchUbpf%2BnY%2BFTUxFNACJZpgoNbEAU8FZHF4g5gi%2Bnqxm4i7w>
