Re: [PATCH RESEND libgpiod v2 13/18] dbus: add gpio-manager code

Thiago Macieira <[email protected]> Tue, 02 Jul 2024 11:01:50 +0200
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <4295673.iGErgHkdLf@tjmaciei-mobl5>
On Monday 1 July 2024 10:28:32 CEST Bartosz Golaszewski wrote:
> On Sun, Jun 30, 2024 at 6:36=E2=80=AFPM Thiago Macieira <[email protected]> =
wrote:
> > [Trimmed list because it's a small comment]
> >=20
> > On Friday 28 June 2024 11:58:32 GMT-7 Bartosz Golaszewski wrote:
> > > +struct _GPIODBusDaemon {
> >=20
> > Leading underscore + capital is reserved to the compiler and therefore
> > this
> > declaration above is Undefined Behaviour.
>=20
> This hasn't been true for decades with modern compilers.

It was never removed from the Standard, therefore it's still true for curre=
nt=20
compilers.

The fact that UB appears to work fine for a given compiler is not an excuse=
=2E UB=20
can manifest in many ways, including working exactly like the developer=20
expected it to work. But the point is that it's not guaranteed to continue=
=20
working like that.

I remember once a colleague had named a variable _Nullable. At some point,=
=20
Clang decided to use that identifier as a keyword to indicate nullable=20
pointers, also adding _Nonnullable. This friend's code promptly stopped=20
compiling. Let's not forget _Atomic, _Bool too, or _Generic.

> It's a pattern recommended by and used throughout GLib and all Gnome
> projects using it.

It's wrong. Glib developers ought to remove the recommendation.

=2D-=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering