This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Again: compile time debug mode


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,



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]