From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74588 invoked by alias); 21 Mar 2019 15:02:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 74564 invoked by uid 89); 21 Mar 2019 15:02:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=H*u:1.3.6, H*UA:1.3.6, H*r:112, opportunity X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Mar 2019 15:02:03 +0000 Received: by simark.ca (Postfix, from userid 112) id 4C64D1E78E; Thu, 21 Mar 2019 11:02:02 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 085E61E4F4; Thu, 21 Mar 2019 11:02:01 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 21 Mar 2019 15:02:00 -0000 From: Simon Marchi To: Eli Zaretskii Cc: tom@tromey.com, gdb-patches@sourceware.org Subject: Re: [PATCH 00/16] Add styling to the gdb CLI and TUI In-Reply-To: <838sx8uwbb.fsf@gnu.org> References: <20181128001435.12703-1-tom@tromey.com> <83k1kxfzwo.fsf@gnu.org> <8736rja4i8.fsf@tromey.com> <83r2brhw8k.fsf@gnu.org> <87h8cmh1wg.fsf@tromey.com> <83va12gz8j.fsf@gnu.org> <87mumeb935.fsf@tromey.com> <83d0n8eyzw.fsf@gnu.org> <87d0n6adk2.fsf@tromey.com> <83imwyee29.fsf@gnu.org> <87d0n67d29.fsf@tromey.com> <83imwwc7pj.fsf@gnu.org> <57558f60-8254-931f-846b-bdd6b60f5798@simark.ca> <838sx8uwbb.fsf@gnu.org> Message-ID: X-Sender: simark@simark.ca User-Agent: Roundcube Webmail/1.3.6 X-SW-Source: 2019-03/txt/msg00458.txt.bz2 > No, it's not unintended. I mentioned that in my preamble: Sorry about that, I see it now. IMO, you could directly push a patch that does these cleanups. >> (Note that I took this opportunity to clean up whitespace in top.c, >> I hope it's OK to do that as part of unrelated code changes.) > >> I know we plan to move to a version scheme where we don't have a >> "patch" >> number (a third number), but just in case, maybe we could plan for it >> anyway >> just in case it ever changes again in the future (I don't expect it >> will, >> but we never know. >> >> So something like MAJOR * 10000 + MINOR * 100 + PATCH * 100 >> >> Also, it means that in your example, 9.11.90 would produce 091190. I >> think >> it's better if we are able to distinguish 9.11.90 from 9.12. > > The idea was that we don't need to distinguish between them. This > feature is intended to be used in scripts that need to know when a > certain feature became available, so IMO resolution below XX.YY is not > needed, because any XX.YY.ZZ version is just a snapshot of XX.YY+1. Ok, fair enough. Since the .90 is supposed to behave exactly how the next version will (and then never used in production again), I'm fine with that. I'm just a little worried that some day we'll introduce back some "patch" number, and then we'll need to change how this number is encoded, which will cause some headaches :). >> Also, we should consider doing like Python does, and encode different >> numbers >> in different bytes: >> >> https://docs.python.org/3/c-api/apiabiversion.html >> >> So we could say ((MAJOR << 16) | (MINOR << 8) | PATCH), for example. >> The >> advantage with this is that it's easy to to isolate a particular >> number >> using bitshifts and masks. I know it would be possible as well in >> decimal >> to isolate a particular number, but it's just more convenient in hex. > > I don't have a strong opinion, but I do have a weak one: the decimal > "encoding" makes it much easier for humans to construct version > numbers, they don't need to convert to hex. There's not much difference in hex, you would just write "if $_gdb_version >= 0x0901" for example, rather than "if $_gdb_version >= 901". But again, my argument for hex is weak too, it's easy enough to extract the GDB version components using some "% 100" and "/ 100". If there's no more compelling argument for hex, I'm fine with decimal. Simon