Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2022 00:56:41 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        Jessica Clarke <jrtc27@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: 05c9a0158f68 - main - libc: Add strverscmp(3) and versionsort(3)
Message-ID:  <YwfwGRF2OjAlu09C@kib.kiev.ua>
In-Reply-To: <20220825213347.GA89898@spindle.one-eyed-alien.net>
References:  <202208250029.27P0TRwK091769@gitrepo.freebsd.org> <FFCE6298-AF3B-4B50-B1C1-B4E01F604B30@freebsd.org> <YwbO8Na3k0BpvWmn@kib.kiev.ua> <20220825213347.GA89898@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <kib@FreeBSD.org> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YwfwGRF2OjAlu09C>