[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFULd4b=aCfWeOHSjH_qxUn-UNOhfqc12iA_rb48-SNKVTgzkg@mail.gmail.com>
Date: Mon, 27 Jan 2025 08:29:40 +0100
From: Uros Bizjak <ubizjak@...il.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
mm-commits@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] MM updates for 6.14-rc1
On Mon, Jan 27, 2025 at 1:08 AM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Sun, 26 Jan 2025 at 15:27, Uros Bizjak <ubizjak@...il.com> wrote:
> >
> > The detection is put in include/linux/compiler.h where we can
> > consolidate checks for both compilers:
>
> No. Please. We have compiler-specific header files for a reason.
> Exactly so that we do *not* need to have disgusting tests like
>
> #if ((defined(__GNUC__) && __GNUC__ >= 14) || \
> (defined(__clang__) && __clang_major__ >= 19)) && \
> !defined(__CHECKER__)
>
> and instead it should just be
>
> #define CC_HAS_TYPEOF_UNQUAL (__clang_major__ >= 19)
>
> in compiler-clang.h, and
>
> #define CC_HAS_TYPEOF_UNQUAL (__GNUC__ >= 14)
>
> in compiler-gcc.h.
>
> And then in the actual compiler.h, we could do
>
> #define USE_TYPEOF_UNQUAL (CC_HAS_TYPEOF_UNQUAL && !defined(__CHECKER__))
>
> and now the places that then want to use __typeof_unqual__ have a very
> straightforward way to check if they should do so.
Got it, I'll do it this way.
Thanks,
Uros.
Powered by blists - more mailing lists