diff options
author | Tom de Vries <tdevries@suse.de> | 2025-01-28 20:56:17 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-01-28 20:56:17 +0100 |
commit | 852cbc7ffadf9daf173e13ea56caff49d52733af (patch) | |
tree | 4e5e1f4cc02b6a4102d30e38f5b5cec9a35b4794 /gdb | |
parent | ae700d95c66340d7e1cfc6b2d72480caed929eb0 (diff) | |
download | gdb-852cbc7ffadf9daf173e13ea56caff49d52733af.zip gdb-852cbc7ffadf9daf173e13ea56caff49d52733af.tar.gz gdb-852cbc7ffadf9daf173e13ea56caff49d52733af.tar.bz2 |
[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.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/guile/guile-internal.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index ef7a1d3..090badd 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -30,18 +30,25 @@ #include "objfiles.h" #include "top.h" -/* GCC introduced C++20 support in GCC 8, using -std=c++2a (the name of the - C++20 standard before publishing) and __cplusplus 201709L. In GCC 10, - -std=c++20 was added, but __cplusplus stayed at 201709L, and was only - changed to the standard 202002L in GCC 11. Consequently, some C++20 - features and restrictions need to be tested against the non-standard - 201709L, otherwise the build with GCC 10 and -std=c++20 will break. */ -#if __cplusplus >= 201709L -/* Work around Werror=volatile in SCM_UNPACK for - SCM_DEBUG_TYPING_STRICTNESS == 1. Reported upstream: - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65333 . */ +/* 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. */ #define SCM_DEBUG_TYPING_STRICTNESS 0 -#endif #include "libguile.h" struct block; |