[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <321c3c0984e64e9cbd1b034755611710@AcuMS.aculab.com>
Date: Fri, 6 Oct 2023 15:51:06 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Kees Cook' <keescook@...omium.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"'linux@...musvillemoes.dk'" <linux@...musvillemoes.dk>,
'Steven Rostedt' <rostedt@...dmis.org>,
"'bvanassche@....org'" <bvanassche@....org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"Nathan Chancellor" <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Arnd Bergmann <arnd@...db.de>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: RE: [PATCH v2 next] compiler.h: Move __is_constexpr() to compiler.h.
It can also be defined more portably as:
#define __is_constexpr(x) \
_Generic(0 ? (void *)((long)(x) * 0) : (int *)0, int *: 1, void *: 0)
Which doesn't rely on 'sizeof (void)' being valid.
But that is for another day.
There is also:
#define is_pointer_type(type) __is_constexpr((type)1)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists