Re: [PATCH 00/16] Add styling to the gdb CLI and TUI

Eli Zaretskii
2019-03-21T18:38:19Z

> Cc: tom@tromey.com, gdb-patches@sourceware.org
> From: Pedro Alves <palves@redhat.com>
> Date: Thu, 21 Mar 2019 18:19:04 +0000
>
> > if $_gdb_version_major >= 9 \
> > Â Â  || ($_gdb_version_major >= 8 && $gdb_version_minor >= 5
> >
> > If you need to check for a range, it's even more complicated.
> >
> > But then, if the version is provided as separate components, nothing prevents you to re-encode it however you want after that.Â  You can do easily enough
> >
> > set $my_gdb_version = ($_gdb_version_major * 100) + $_gdb_version_minor
> >
> > if you want, and use the simple comparison.Â  And everyone is free to choose their own encoding :).Â  So, to me separate components sounds better.
>
> Exactly my thoughts. That's what the GCC manual describes, BTW:
>
> https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

And I've seen my share of erroneous version checks using the GCC
macros.

But if there's a consensus to go with 2 separate numbers, I'm okay
with redoing the patch that way.