projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7fd2df2
)
gcc-plugins: Always define CONST_CAST_GIMPLE and CONST_CAST_TREE
author
Kees Cook
<kees@kernel.org>
Sat, 14 Mar 2026 13:24:56 +0000
(14:24 +0100)
committer
Kees Cook
<kees@kernel.org>
Thu, 14 May 2026 16:24:32 +0000
(09:24 -0700)
For gcc-16, the CONST_CAST macro family was removed. Add back what
we were using in gcc-common.h, as they are simple wrappers.
See GCC commits:
c3d96ff9e916c02584aa081f03ab999292efbb50
458c7926d48959abcb2c1adaa22458e27459a551
Suggested-by: Ingo Saitz <ingo@hannover.ccc.de>
Link:
https://lore.kernel.org/lkml/ab6OKoay0OWkywjK@spatz.zoo
Fixes:
6b90bd4ba40b
("GCC plugin infrastructure")
Tested-by: Ivan Bulatovic <combuster@archlinux.us>
Tested-by: Christopher Cradock <christopher@cradock.myzen.co.uk>
Signed-off-by: Kees Cook <kees@kernel.org>
scripts/gcc-plugins/gcc-common.h
patch
|
blob
|
history
diff --git
a/scripts/gcc-plugins/gcc-common.h
b/scripts/gcc-plugins/gcc-common.h
index
8f1b350
..
abb1964
100644
(file)
--- a/
scripts/gcc-plugins/gcc-common.h
+++ b/
scripts/gcc-plugins/gcc-common.h
@@
-309,7
+309,9
@@
typedef const gimple *const_gimple_ptr;
#define gimple gimple_ptr
#define const_gimple const_gimple_ptr
#undef CONST_CAST_GIMPLE
-#define CONST_CAST_GIMPLE(X) CONST_CAST(gimple, (X))
+#define CONST_CAST_GIMPLE(X) const_cast<gimple>((X))
+#undef CONST_CAST_TREE
+#define CONST_CAST_TREE(X) const_cast<tree>((X))
/* gimple related */
static inline gimple gimple_build_assign_with_ops(enum tree_code subcode, tree lhs, tree op1, tree op2 MEM_STAT_DECL)