2025-05-30 17:04:49 +02:00
|
|
|
From cd4f4a663f82e2f8bee58f3ef000964a2dd82769 Mon Sep 17 00:00:00 2001
|
2025-04-25 21:16:26 +02:00
|
|
|
From: Tom de Vries <tdevries@suse.de>
|
2025-05-30 17:04:49 +02:00
|
|
|
Date: Tue, 28 Jan 2025 20:56:17 +0100
|
2025-04-25 21:16:26 +02:00
|
|
|
Subject: [PATCH] [gdb/guile] Use SCM_DEBUG_TYPING_STRICTNESS 0
|
|
|
|
|
|
|
|
I build gdb with libguile v2.0.9, and ran into:
|
|
|
|
...
|
|
|
|
In file included from /usr/include/guile/2.0/libguile.h:56,
|
|
|
|
from ../../gdb/guile/guile-internal.h:30,
|
|
|
|
from ../../gdb/guile/scm-arch.c:26:
|
|
|
|
/usr/include/guile/2.0/libguile/inline.h: In function 'int scm_is_pair(SCM)':
|
|
|
|
/usr/include/guile/2.0/libguile/tags.h:97:53: error: \
|
|
|
|
operation on '*0' may be undefined [-Werror=sequence-point]
|
|
|
|
# define SCM_UNPACK(x) ((scm_t_bits) (0? (*(SCM*)0=(x)): x))
|
|
|
|
~~~~~~~~~^~~~~
|
|
|
|
...
|
|
|
|
|
|
|
|
Fix this by using SCM_DEBUG_TYPING_STRICTNESS 0.
|
|
|
|
|
|
|
|
We were already using this for c++20 due to a Werror=volatile in SCM_UNPACK
|
|
|
|
when using libguile v2.0.10.
|
|
|
|
|
|
|
|
Tested on x86_64-linux.
|
2025-05-30 17:04:49 +02:00
|
|
|
|
|
|
|
Approved-By: Tom Tromey <tom@tromey.com>
|
2025-04-25 21:16:26 +02:00
|
|
|
---
|
2025-05-30 17:04:49 +02:00
|
|
|
gdb/guile/guile-internal.h | 23 ++++++++++++++++++-----
|
|
|
|
1 file changed, 18 insertions(+), 5 deletions(-)
|
2025-04-25 21:16:26 +02:00
|
|
|
|
|
|
|
diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h
|
2025-05-30 17:04:49 +02:00
|
|
|
index 8d83b8b808a..85e08ca905d 100644
|
2025-04-25 21:16:26 +02:00
|
|
|
--- a/gdb/guile/guile-internal.h
|
|
|
|
+++ b/gdb/guile/guile-internal.h
|
2025-05-30 17:04:49 +02:00
|
|
|
@@ -30,12 +30,25 @@
|
2025-04-25 21:16:26 +02:00
|
|
|
#include "objfiles.h"
|
|
|
|
#include "top.h"
|
|
|
|
|
2025-05-30 17:04:49 +02:00
|
|
|
-#if __cplusplus >= 202002L
|
|
|
|
-/* Work around Werror=volatile in SCM_UNPACK for
|
|
|
|
- SCM_DEBUG_TYPING_STRICTNESS == 1. Reported upstream:
|
|
|
|
- https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65333 . */
|
2025-04-25 21:16:26 +02:00
|
|
|
+/* For libguile v2.0.9 and SCM_DEBUG_TYPING_STRICTNESS == 1, SCM_UNPACK(x) is
|
|
|
|
+ defined as:
|
|
|
|
+
|
|
|
|
+ ((scm_t_bits) (0? (*(SCM*)0=(x)): x))
|
|
|
|
+
|
|
|
|
+ and for v2.0.10 it's defined as:
|
|
|
|
+
|
|
|
|
+ ((scm_t_bits) (0? (*(volatile SCM *)0=(x)): x))
|
|
|
|
+
|
|
|
|
+ The volatile was added to avoid a clang warning.
|
|
|
|
+
|
|
|
|
+ The latter form causes a Werror=volatile with C++20.
|
|
|
|
+ This was reported upstream (
|
|
|
|
+ https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65333 ).
|
|
|
|
+
|
|
|
|
+ The former form causes a Werror=sequence-point with gcc 7-14.
|
|
|
|
+
|
|
|
|
+ Work around these problem by using SCM_DEBUG_TYPING_STRICTNESS == 0. */
|
2025-05-30 17:04:49 +02:00
|
|
|
#define SCM_DEBUG_TYPING_STRICTNESS 0
|
|
|
|
-#endif
|
|
|
|
#include "libguile.h"
|
|
|
|
|
2025-04-25 21:16:26 +02:00
|
|
|
struct block;
|
|
|
|
|
2025-05-30 17:04:49 +02:00
|
|
|
base-commit: e76eb034e25f53ef2c17eab700e95d07bbbdc7aa
|
2025-04-25 21:16:26 +02:00
|
|
|
--
|
|
|
|
2.43.0
|
|
|
|
|