Re: git: 005aa1743b42 - main - modules: bzero the modspecific_t
- In reply to: Brooks Davis : "Re: git: 005aa1743b42 - main - modules: bzero the modspecific_t"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 04 Jul 2023 00:07:50 UTC
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