summaryrefslogtreecommitdiff
path: root/libguile/__scm.h
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/__scm.h')
-rw-r--r--libguile/__scm.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/libguile/__scm.h b/libguile/__scm.h
index 2a06b9caa..f5e7ed3a0 100644
--- a/libguile/__scm.h
+++ b/libguile/__scm.h
@@ -55,6 +55,38 @@
should go in __scm.h. */
+/* {Compiler hints}
+ *
+ * The following macros are used to provide additional information for the
+ * compiler, which may help to do better error checking and code
+ * optimization. A second benefit of these macros is, that they also provide
+ * additional information to the developers.
+ */
+
+/* The macro SCM_NORETURN indicates that a function will never return.
+ * Examples:
+ * 1) int foo (char arg) SCM_NORETURN;
+ */
+#ifdef __GNUC__
+#define SCM_NORETURN __attribute__ ((noreturn))
+#else
+#define SCM_NORETURN
+#endif
+
+/* The macro SCM_UNUSED indicates that a function, function argument or
+ * variable may potentially be unused.
+ * Examples:
+ * 1) static int unused_function (char arg) SCM_UNUSED;
+ * 2) int foo (char unused_argument SCM_UNUSED);
+ * 3) int unused_variable SCM_UNUSED;
+ */
+#ifdef __GNUC__
+#define SCM_UNUSED __attribute__ ((unused))
+#else
+#define SCM_UNUSED
+#endif
+
+
/* {Supported Options}
*
* These may be defined or undefined.
@@ -177,6 +209,14 @@
#define SCM_DEBUG_INTERRUPTS SCM_DEBUG
#endif
+/* If SCM_DEBUG_PAIR_ACCESSES is set to 1, accesses to cons cells will be
+ * exhaustively checked. Note: If this option is enabled, guile will run
+ * slower than normally.
+ */
+#ifndef SCM_DEBUG_PAIR_ACCESSES
+#define SCM_DEBUG_PAIR_ACCESSES SCM_DEBUG
+#endif
+
/* If SCM_DEBUG_REST_ARGUMENT is set to 1, functions that take rest arguments
* will check whether the rest arguments are actually passed as a proper list.
* Otherwise, if SCM_DEBUG_REST_ARGUMENT is 0, functions that take rest