[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#115400



I took a look at the diff Rob Browning suggested, but it doesn't
appear to address the problem.  That diff is at the end of this
message.

So instead of looking at this diff, i opened the ChangeLog.  What
i found does not look good:

2001-06-14  Marius Vollmer  <mvo@zagadka.ping.de>

        * unif.h (SCM_ARRAY_NDIM): Shift then cast so that no sign
        extension takes place.
        * strings.h (SCM_STRING_LENGTH): Likewise.
        (SCM_STRING_MAX_LENGTH): Use unsigned numbers.

        * __scm.h (ptrdiff_t): Typedef to long when configure didn't find
        it.

        * tags.h: Include <stdint.h> when we have it.
        (scm_bits_t): Changed to be a unsigned type.  Use uintptr_t when
        available.  Else use "unsigned long".
        (scm_signed_bits_t): New.

        * numbers.h (SCM_SRS): Cast shiftee to scm_signed_bits_t.
        (SCM_INUM): Cast result to scm_signed_bits_t.

As you can see, a fundamental change to the Guile internals to
solve a fundamental problem.  This is an incompatible change.
We could make it, but it involves bumping the soname (but upstream
already does that; there's nothing we can bump it to).  Anyway,
it would no longer be Guile 1.4.

Anyone see anything wrong with my analysis?  I hope so...


*******************************************************************************
The diff:

Index: libguile/ChangeLog
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/ChangeLog,v
retrieving revision 1.1510
retrieving revision 1.1514
diff -a -u -r1.1510 -r1.1514
--- libguile/ChangeLog	17 Sep 2001 20:32:53 -0000	1.1510
+++ libguile/ChangeLog	21 Sep 2001 17:56:59 -0000	1.1514
@@ -1,3 +1,58 @@
+2001-09-21  Rob Browning  <rlb@defaultvalue.org>
+
+	* .cvsignore: really add version.h
+
+	* strings.h (SCM_SET_STRING_LENGTH): coerce "l" to a long.
+	Otherwise it fails on the alpha.  However, we might rather choose
+	this size conditionally.
+
+	* numbers.c (scm_gcd): change "k" to a long from an int.
+	Otherwise it fails on the alpha.  However, we might rather choose
+	this size conditionally.
+
+	* error.c (scm_wta): coerce char* to intptr_t before int
+	assignment.
+
+	* debug.c (debugobj_print): coerce scm_intprint arg 1 to long, not
+	int.
+
+	* chars.h (SCM_MAKE_CHAR): coerce value to intptr_t.
+
+2001-09-20  Mikael Djurfeldt  <mdj@linnaeus>
+
+	* numbers.c (scm_integer_expt): Accept inexact integer in second
+	argument.  (Thanks to Bill Schottstaedt.)
+
+2001-09-20  Rob Browning  <rlb@defaultvalue.org>
+
+	* .cvsignore: add version.h
+
+	* versiondat.h.in: removed (obsolete).
+
+	* version.h.in: renamed from version.h.
+	(SCM_GUILE_MAJOR_VERSION): new public macro.
+	(SCM_GUILE_MINOR_VERSION): new public macro.
+	(SCM_GUILE_MICRO_VERSION): new public macro.
+
+	* version.h: renamed to version.h.in.
+
+	* version.c
+	(scm_major_version): support integer *_VERSION macros.
+	(scm_minor_version): support integer *_VERSION macros.
+	(scm_micro_version): support integer *_VERSION macros.
+	(scm_version): support integer *_VERSION macros.
+
+2001-09-20  Mikael Djurfeldt  <mdj@linnaeus>
+
+	* error.c, error.h: Made error keys globally accessible.
+	Applications might want to test for these or use them in a direct
+	call to scm_error.
+
+	* num2integral.i.c (NUM2INTEGRAL): Report an error when these
+	routines are passed an inexact.  This change in behavior is
+	motivated by concordance with R5RS: It is more common that a
+	primitive doesn't want to accept an inexact for an exact.
+
 2001-09-17  Dirk Herrmann  <D.Herrmann@tu-bs.de>
 
         The following patch partially undoes my patch from 2001-06-30,
Index: libguile/chars.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/chars.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -a -u -r1.13 -r1.14
--- libguile/chars.h	31 Aug 2001 10:42:19 -0000	1.13
+++ libguile/chars.h	21 Sep 2001 17:56:39 -0000	1.14
@@ -53,7 +53,7 @@
  */
 #define SCM_CHARP(x) (SCM_ITAG8(x) == scm_tc8_char)
 #define SCM_CHAR(x) ((unsigned int)SCM_ITAG8_DATA(x))
-#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8(x, scm_tc8_char)
+#define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8((intptr_t) x, scm_tc8_char)
 
 
 
Index: libguile/numbers.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/numbers.c,v
retrieving revision 1.140
retrieving revision 1.142
diff -a -u -r1.140 -r1.142
--- libguile/numbers.c	1 Sep 2001 17:17:50 -0000	1.140
+++ libguile/numbers.c	21 Sep 2001 17:56:31 -0000	1.142
@@ -383,7 +383,7 @@
       } else if (yy == 0) {
 	result = u;
       } else {
-	int k = 1;
+	long k = 1;
 	long t;
 
 	/* Determine a common factor 2^k */
@@ -1118,7 +1118,15 @@
   else if (SCM_EQ_P (n, SCM_MAKINUM (-1L)))
     return SCM_FALSEP (scm_even_p (k)) ? n : acc;
 #endif
-  SCM_VALIDATE_ULONG_COPY (2,k,i2);
+  if (SCM_REALP (k))
+    {
+      double r = SCM_REAL_VALUE (k);
+      i2 = r;
+      if (i2 != r)
+	SCM_WRONG_TYPE_ARG (2, k);
+    }
+  else
+    SCM_VALIDATE_ULONG_COPY (2,k,i2);
   if (i2 < 0)
     {
       i2 = -i2;
Index: libguile/strings.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/strings.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -a -u -r1.35 -r1.36
--- libguile/strings.h	12 Sep 2001 19:53:57 -0000	1.35
+++ libguile/strings.h	21 Sep 2001 17:56:17 -0000	1.36
@@ -56,7 +56,7 @@
 #define SCM_SET_STRING_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c)))
 #define SCM_STRING_MAX_LENGTH ((1UL << 24) - 1UL)
 #define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8))
-#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_string))
+#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), (((long) (l)) << 8) + scm_tc7_string))
 
 
 



Reply to: