[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patch] CVS-Guile dump.c compilation problems
From: |
Matthias Koeppe |
Subject: |
[Patch] CVS-Guile dump.c compilation problems |
Date: |
15 Feb 2001 12:29:41 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 |
I compile Guile with the Sun Workshop 6 update 1 ("Forte") compiler.
The compiler complains about code in `scm_undump', where you try to
take the address of SCM_CDR(obj) and SCM_CAR(obj). This is probably
not a good idea because SCM_CDR(obj) is not guaranteed to be an
lvalue. Another issue was a signed/unsigned discrepancy.
A patch is attached below.
Index: libguile/dump.c
===================================================================
RCS file: /cvs/guile/guile-core/libguile/dump.c,v
retrieving revision 1.6
diff -u -r1.6 dump.c
--- libguile/dump.c 2001/02/10 07:09:45 1.6
+++ libguile/dump.c 2001/02/15 11:17:57
@@ -456,10 +456,14 @@
if (SCM_ITAG3 (SCM_PACK (tc)) == scm_tc3_cons)
{
+ SCM tmp;
SCM_NEWCELL (obj);
/* cdr was stored first */
- scm_restore_object ((SCM *) &SCM_CDR (obj), dstate);
- scm_restore_object ((SCM *) &SCM_CAR (obj), dstate);
+
+ scm_restore_object (&tmp, dstate);
+ SCM_SETCDR(obj, tmp);
+ scm_restore_object (&tmp, dstate);
+ SCM_SETCAR(obj, tmp);
goto store_object;
}
@@ -467,7 +471,7 @@
{
case scm_tc7_symbol:
{
- int len;
+ scm_sizet len;
const char *mem;
scm_restore_string (&mem, &len, dstate);
obj = scm_mem2symbol (mem, len);
@@ -475,7 +479,7 @@
}
case scm_tc7_string:
{
- int len;
+ scm_sizet len;
const char *mem;
scm_restore_string (&mem, &len, dstate);
obj = scm_makfromstr (mem, len, 0);
--
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe
- [Patch] CVS-Guile dump.c compilation problems,
Matthias Koeppe <=