Fix infinite loop in expander
[bpt/guile.git] / libguile / tags.h
index fcfc014..a5082f8 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef SCM_TAGS_H
 #define SCM_TAGS_H
 
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2008,2009,2010,2011,2012
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2008,2009,2010,2011,2012,2013,2014,2015
  * Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -87,14 +87,15 @@ typedef union SCM { struct { scm_t_bits n; } n; } SCM;
   The 0?: constructions makes sure that the code is never executed,
   and that there is no performance hit.  However, the alternative is
   compiled, and does generate a warning when used with the wrong
-  pointer type.
+  pointer type.  We use a volatile pointer type to avoid warnings
+  from clang.
 
   The Tru64 and ia64-hp-hpux11.23 compilers fail on `case (0?0=0:x)'
   statements, so for them type-checking is disabled.  */
 #if defined __DECC || defined __HP_cc
 #   define SCM_UNPACK(x) ((scm_t_bits) (x))
 #else
-#   define SCM_UNPACK(x) ((scm_t_bits) (0? (*(SCM*)0=(x)): x))
+#   define SCM_UNPACK(x) ((scm_t_bits) (0? (*(volatile SCM *)0=(x)): x))
 #endif
 
 /*
@@ -334,14 +335,9 @@ typedef union SCM { struct { scm_t_bits n; } n; } SCM;
  *   111:  the cell belongs to some other heap object.
  *
  * tc7 (for tc3==1x1):
- *   See below for the list of types.  Note the special case of scm_tc7_vector
- *   and scm_tc7_wvect:  vectors and weak vectors are treated the same in many
- *   cases.  Thus, their tc7-codes are chosen to only differ in one bit.  This
- *   makes it possible to check an object at the same time for being a vector
- *   or a weak vector by comparing its tc7 code with that bit masked (using
- *   the TYP7S macro).  Three more special tc7-codes are of interest:
- *   numbers, ports and smobs in fact each represent collections of types,
- *   which are subdivided using tc16-codes.
+ *   See below for the list of types.  Three special tc7-codes are of
+ *   interest: numbers, ports and smobs in fact each represent
+ *   collections of types, which are subdivided using tc16-codes.
  *
  * tc16 (for tc7==scm_tc7_smob):
  *   The largest part of the space of smob types is not subdivided in a
@@ -395,11 +391,12 @@ typedef union SCM { struct { scm_t_bits n; } n; } SCM;
 
 #define SCM_ITAG7(x)           (127 & SCM_UNPACK (x))
 #define SCM_TYP7(x)            (0x7f &        SCM_CELL_TYPE (x))
-#define SCM_TYP7S(x)           ((0x7f & ~2) & SCM_CELL_TYPE (x))
 #define SCM_HAS_HEAP_TYPE(x, type, tag)                         \
   (SCM_NIMP (x) && type (x) == (tag))
 #define SCM_HAS_TYP7(x, tag)    (SCM_HAS_HEAP_TYPE (x, SCM_TYP7, tag))
-#define SCM_HAS_TYP7S(x, tag)   (SCM_HAS_HEAP_TYPE (x, SCM_TYP7S, tag))
+
+/* If you change these numbers, change them also in (system vm
+   assembler).  */
 
 #define scm_tc7_symbol         5
 #define scm_tc7_variable        7
@@ -419,14 +416,14 @@ typedef union SCM { struct { scm_t_bits n; } n; } SCM;
 #define scm_tc7_dynamic_state  45
 
 #define scm_tc7_frame          47
-#define scm_tc7_objcode                53
-#define scm_tc7_vm             55
+#define scm_tc7_keyword                53
+#define scm_tc7_unused_55      55
 #define scm_tc7_vm_cont                71
 
 #define scm_tc7_unused_17      61
 #define scm_tc7_unused_21      63
-#define scm_tc7_rtl_program    69
-#define scm_tc7_program                79
+#define scm_tc7_program                69
+#define scm_tc7_unused_79      79
 #define scm_tc7_weak_set       85
 #define scm_tc7_weak_table     87
 #define scm_tc7_array          93