* [PATCH] linux/compiler.h: don't use bool
@ 2018-08-17 10:10 Rasmus Villemoes
2018-08-17 20:39 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Rasmus Villemoes @ 2018-08-17 10:10 UTC (permalink / raw)
To: Andrew Morton, Christopher Li
Cc: Rasmus Villemoes, linux-sparse, linux-kernel
Appararently, it's possible to have a non-trivial TU include a few headers,
including linux/build_bug.h, without ending up with linux/types.h. So
the 0day bot sent me
config: um-x86_64_defconfig (attached as .config)
>> include/linux/compiler.h:316:3: error: unknown type name 'bool'; did you mean '_Bool'?
bool __cond = !(condition); \
for something I'm working on.
Rather than contributing to the #include madness and including
linux/types.h from compiler.h, just use int.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/linux/compiler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 42506e4d1f53..c8eab637a2a7 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -313,7 +313,7 @@ unsigned long read_word_at_a_time(const void *addr)
#ifdef __OPTIMIZE__
# define __compiletime_assert(condition, msg, prefix, suffix) \
do { \
- bool __cond = !(condition); \
+ int __cond = !(condition); \
extern void prefix ## suffix(void) __compiletime_error(msg); \
if (__cond) \
prefix ## suffix(); \
--
2.16.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] linux/compiler.h: don't use bool
2018-08-17 10:10 [PATCH] linux/compiler.h: don't use bool Rasmus Villemoes
@ 2018-08-17 20:39 ` Andrew Morton
2018-08-17 20:43 ` Josh Triplett
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2018-08-17 20:39 UTC (permalink / raw)
To: Rasmus Villemoes; +Cc: Christopher Li, linux-sparse, linux-kernel
On Fri, 17 Aug 2018 12:10:35 +0200 Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
> Appararently, it's possible to have a non-trivial TU include a few headers,
> including linux/build_bug.h, without ending up with linux/types.h. So
> the 0day bot sent me
What's a "TU"?
>
> config: um-x86_64_defconfig (attached as .config)
>
> >> include/linux/compiler.h:316:3: error: unknown type name 'bool'; did you mean '_Bool'?
> bool __cond = !(condition); \
>
> for something I'm working on.
>
> Rather than contributing to the #include madness and including
> linux/types.h from compiler.h, just use int.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] linux/compiler.h: don't use bool
2018-08-17 20:39 ` Andrew Morton
@ 2018-08-17 20:43 ` Josh Triplett
0 siblings, 0 replies; 3+ messages in thread
From: Josh Triplett @ 2018-08-17 20:43 UTC (permalink / raw)
To: Andrew Morton, Rasmus Villemoes
Cc: Christopher Li, linux-sparse, linux-kernel
On August 17, 2018 1:39:35 PM PDT, Andrew Morton <akpm@linux-foundation.org> wrote:
>On Fri, 17 Aug 2018 12:10:35 +0200 Rasmus Villemoes
><linux@rasmusvillemoes.dk> wrote:
>
>> Appararently, it's possible to have a non-trivial TU include a few
>headers,
>> including linux/build_bug.h, without ending up with linux/types.h. So
>> the 0day bot sent me
>
>What's a "TU"?
Probably "translation unit".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-17 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17 10:10 [PATCH] linux/compiler.h: don't use bool Rasmus Villemoes
2018-08-17 20:39 ` Andrew Morton
2018-08-17 20:43 ` Josh Triplett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).