[PATCH RESEND libgpiod v2 13/18] dbus: add gpio-manager code
Thiago Macieira
thiago at kde.org
Tue Jul 2 09:01:50 UTC 2024
On Monday 1 July 2024 10:28:32 CEST Bartosz Golaszewski wrote:
> On Sun, Jun 30, 2024 at 6:36 PM Thiago Macieira <thiago at kde.org> wrote:
> > [Trimmed list because it's a small comment]
> >
> > On Friday 28 June 2024 11:58:32 GMT-7 Bartosz Golaszewski wrote:
> > > +struct _GPIODBusDaemon {
> >
> > Leading underscore + capital is reserved to the compiler and therefore
> > this
> > declaration above is Undefined Behaviour.
>
> This hasn't been true for decades with modern compilers.
It was never removed from the Standard, therefore it's still true for current
compilers.
The fact that UB appears to work fine for a given compiler is not an excuse. UB
can manifest in many ways, including working exactly like the developer
expected it to work. But the point is that it's not guaranteed to continue
working like that.
I remember once a colleague had named a variable _Nullable. At some point,
Clang decided to use that identifier as a keyword to indicate nullable
pointers, also adding _Nonnullable. This friend's code promptly stopped
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.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Principal Engineer - Intel DCAI Platform & System Engineering
More information about the dbus
mailing list