From: Ingo Saitz <ingo@hannover.ccc.de>
To: Kees Cook <kees@kernel.org>
Cc: "Ingo Saitz" <ingo@hannover.ccc.de>,
"Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Build error in next-20260223 gcc-plugins/latent_entropy_plugin.so
Date: Sat, 21 Mar 2026 13:25:14 +0100 [thread overview]
Message-ID: <ab6OKoay0OWkywjK@spatz.zoo> (raw)
In-Reply-To: <202603201220.8E538CC1@keescook>
On Fri, Mar 20, 2026 at 12:23:10PM -0700, Kees Cook wrote:
> Thanks for this!
>
> Should CONST_CAST_TREE be explicitly defined instead, to match
> CONST_CAST_GIMPLE in the this header file? It seems weird to have one of
> two done this way: we should either do both or neither (CONST_CAST_GIMPLE
> is only used in the header file too).
My first idea was to simplay guard this depending on the gcc version,
since the CONST_CAST_TREE type changed from (union tree_node *) to tree.
But the typedef union tree_node *tree (in gcc source: gcc/coretypes.h)
is already there in gcc-8, and const_cast is an old c++ feature.
> Is const_cast<gimple> and const_cast<tree> valid back through GCC 8
> (earliest Linux-supported GCC)?
I successfully compiled and booted linux 6.19.8 with my patch applied
with gcc-8 (Debian 8.3.0-7) 8.3.0, so it think this patch does work with
all supported gcc versions and a guard is not needed indeed.
I tried to minimize the changes, since I don't really know how gcc
plugins actually work. But changing CONST_CAST_GIMPLE to
const_cast<gimple>, too, should not fail since that's now a simple text
replacement.
Ingo
--
const_cast<long double>(Λ)
prev parent reply other threads:[~2026-03-21 12:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 5:20 Build error in next-20260223 gcc-plugins/latent_entropy_plugin.so Valdis Klētnieks
2026-02-25 7:33 ` Kees Cook
2026-02-25 15:14 ` Valdis Klētnieks
2026-03-14 13:50 ` Ingo Saitz
2026-03-14 14:44 ` Ingo Saitz
2026-03-20 19:23 ` Kees Cook
2026-03-21 12:25 ` Ingo Saitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab6OKoay0OWkywjK@spatz.zoo \
--to=ingo@hannover.ccc.de \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=valdis.kletnieks@vt.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox