[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 2 Feb 2022 15:43:02 +0000
From: "Uecker, Martin" <Martin.Uecker@....uni-goettingen.de>
To: "keescook@...omium.org" <keescook@...omium.org>,
"linux@...musvillemoes.dk" <linux@...musvillemoes.dk>,
"corbet@....net" <corbet@....net>,
"David.Laight@...LAB.COM" <David.Laight@...LAB.COM>
CC: "mingo@...nel.org" <mingo@...nel.org>,
"rikard.falkeborn@...il.com" <rikard.falkeborn@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hardening@...r.kernel.org" <linux-hardening@...r.kernel.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"miguel.ojeda.sandonis@...il.com" <miguel.ojeda.sandonis@...il.com>,
"gustavoars@...nel.org" <gustavoars@...nel.org>,
"penguin-kernel@...ove.SAKURA.ne.jp"
<penguin-kernel@...ove.SAKURA.ne.jp>,
"andy.shevchenko@...il.com" <andy.shevchenko@...il.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"arnd@...db.de" <arnd@...db.de>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"ndesaulniers@...gle.com" <ndesaulniers@...gle.com>
Subject: Re: [PATCH] linux/const.h: Explain how __is_constexpr() works
Am Mittwoch, den 02.02.2022, 08:49 +0000 schrieb David Laight:
> From: Rasmus Villemoes
> > Sent: 01 February 2022 13:06
> ...
> > > + * - The C standard defines an "integer constant expression" as different
> > > + * from a "null pointer constant" (an integer constant 0 pointer).
> >
> > I don't see the point of this bullet. Yes, an ICE is a distinct concept
> > from a null pointer constant, obviously. One is defined in terms of the
> > other - and your parenthesis is not an accurate paraphrase of the
> > definition of a null pointer constant.
>
> From what I remember a "null pointer constant" is in "integer constant
> expression with value 0 cast to a pointer type".
> So (void *)(1-1) is just as valid as (void *)0.
>
> Not sure any of it is relevant here.
The C standard (at least public drafts essentially
identical to the actual standards) can be found here:
http://www.open-std.org/jtc1/sc22/wg14/www/projects#9899
"An integer constant expression with the value 0, or such
an expression cast to type void *, is called a null pointer
constant."
BTW: I think it would be very valuable if WG14 would get
proposals and/or comments from the kernel community.
Martin
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
Powered by blists - more mailing lists