This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Again: compile time debug mode
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: Again: compile time debug mode
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Fri, 26 Nov 1999 16:22:32 +0100 (MET)
Hi!
Some time ago we had a fruitful discussion about how to make guile more
safe against confusing SCM and long values.
What about applying some patch like below, which was taken from a mail
from Ken Raeburn? In the beginning this patch does not inhibit any
compilation, but allows for smoothly changing guile's source in a way that
it will finally be possible to compile with GUILE_COMPILE_TIME_DEBUG_MODE
defined.
However, I thing there should be a better name for SCM_BITS, but I have to
admit that I am not very good at providing good names for myself.
Let's just start to make guile safer!
Dirk Herrmann
diff -u -p -r1.30 tags.h
--- tags.h 1999/11/19 18:16:19 1.30
+++ tags.h 1999/11/26 15:11:01
@@ -52,8 +52,13 @@
/* In the beginning was the Word:
*/
-typedef long SCM;
-
+#ifdef GUILE_COMPILE_TIME_DEBUG_MODE
+ typedef union { long n; } SCM;
+ #define SCM_BITS(X) ((X).n)
+#else
+ typedef long SCM;
+ #define SCM_BITS(X) (X)
+#endif
/* Cray machines have pointers that are incremented once for each word,