Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 2023 21:24:11 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Ka Ho Ng <khng@freebsd.org>
Cc:        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:  <ZKM8e7cdDsKuIbRf@spindle.one-eyed-alien.net>
In-Reply-To: <202307012259.361MxM4i017090@gitrepo.freebsd.org>
References:  <202307012259.361MxM4i017090@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 01, 2023 at 10:59:22PM +0000, Ka Ho Ng wrote:
> The branch main has been updated by khng:
>=20
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D005aa1743b42b52fbd49b9d5ec=
44816902b6ee9f
>=20
> 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
>=20
>     modules: bzero the modspecific_t
>    =20
>     Per https://reviews.llvm.org/D68115, only the first field is
>     zero-initialized, meanwhile other fields are undef.
>    =20
>     The pattern can be observed on clang as well, that when
>     -ftrivial-auto-var-init=3Dpattern 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 =3D {}
to zero things, but we've got a ways to go...

-- Brooks



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZKM8e7cdDsKuIbRf>