From nobody Thu Aug 25 21:56:41 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MDGyb12Ccz4ZcyX; Thu, 25 Aug 2022 21:56:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4MDGyZ6Cwpz3svm; Thu, 25 Aug 2022 21:56:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 27PLufjE079972 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 26 Aug 2022 00:56:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 27PLufW0079971; Fri, 26 Aug 2022 00:56:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Aug 2022 00:56:41 +0300 From: Konstantin Belousov To: Brooks Davis Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 05c9a0158f68 - main - libc: Add strverscmp(3) and versionsort(3) Message-ID: References: <202208250029.27P0TRwK091769@gitrepo.freebsd.org> <20220825213347.GA89898@spindle.one-eyed-alien.net> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220825213347.GA89898@spindle.one-eyed-alien.net> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on tom.home X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4MDGyZ6Cwpz3svm X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Aug 25, 2022 at 09:33:47PM +0000, Brooks Davis wrote: > On Thu, Aug 25, 2022 at 04:22:56AM +0300, Konstantin Belousov wrote: > > On Thu, Aug 25, 2022 at 02:07:12AM +0100, Jessica Clarke wrote: > > > On 25 Aug 2022, at 01:29, Konstantin Belousov wrote: > > > > + const unsigned char *u1 = __DECONST(const unsigned char *, s1); > > > > + const unsigned char *u2 = __DECONST(const unsigned char *, s2); > > > > > > Why is __DECONST needed? Casting from const char * to const unsigned > > > char * should never warn, surely? > > > > I requested the use of __DECONST there. Nobody knows what would be next > > trend in the C language breaking among compiler writers. We guarantee > > that __DECONST() is adopted to whatever warnings are added. > > We're not going to add an obfuscated cast through uintptr_t for every > change of signedness. That would be absurd and there is no reason to > belive a future C would ever require it. Whatever it takes, I believe we need an analog of reinterpret_cast<> in cdefs.h.