[Bug algol68/123982] -Wlto-type-mismatch warnings with preludes in Algol 68
jemarch at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 5 10:36:54 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123982
--- Comment #1 from Jose E. Marchesi <jemarch at gcc dot gnu.org> ---
This commit should fix the issue:
>From befd9c02eb70ede5185e531684c11ed6b6f56c0d Mon Sep 17 00:00:00 2001
Date: Thu, 5 Feb 2026 11:34:01 +0100
Subject: [COMMITTED] a68: fix function type in a68_lower_revelation_ludes
Turns out that:
build_function_type_list (void_type_node, void_type_node, NULL_TREE)
doesn't do what I thought it does. It resulted in a function type
getting two `void' arguments, and this was triggering a warning in LTO
mode.
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog
* a68-low-clauses.cc (a68_lower_revelation_ludes): Fix function
type for fdecl.
---
gcc/algol68/a68-low-clauses.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/algol68/a68-low-clauses.cc b/gcc/algol68/a68-low-clauses.cc
index 26607d7f422..bdd857b7e0b 100644
--- a/gcc/algol68/a68-low-clauses.cc
+++ b/gcc/algol68/a68-low-clauses.cc
@@ -1407,9 +1407,9 @@ a68_lower_revelation_ludes (NODE_T *p, bool prelude)
tree fdecl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL,
get_identifier (fname),
- build_function_type_list (void_type_node,
- void_type_node,
- NULL_TREE));
+ build_function_type (void_type_node,
+ void_list_node));
+
DECL_EXTERNAL (fdecl) = 1;
TREE_PUBLIC (fdecl) = 1;
a68_add_decl (fdecl);
--
2.39.5
More information about the Gcc-bugs
mailing list