unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Hans Aberg <haberg-1@telia.com>
Cc: 10681@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: bug#10681: GNU Guile 2.0.5 released
Date: Tue, 31 Jan 2012 20:42:55 -0500	[thread overview]
Message-ID: <87pqdze3c0.fsf@netris.org> (raw)
In-Reply-To: <97851F48-92D8-4547-94F0-4945FCE74679@telia.com> (Hans Aberg's message of "Tue, 31 Jan 2012 23:02:43 +0100")

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

Hans Aberg <haberg-1@telia.com> writes:
> With gcc-4.7.0 (from SVN), the test-ffi test now passes (libffi from
> GIT)

Excellent!  I guess that this was a libffi bug.

> but I get three other failures.
>
> The compiler that is normally used on the system, is llvm-gcc-4.2, and
> its compile is still running.

Please let us know the results of 'make check' when compiling with
llvm-gcc-4.2.  I'm especially curious to hear whether the bytevector
tests fail with that compiler as well.

> Running bytevectors.test
> FAIL: bytevectors.test: 2.3 Operations on Bytes and Octets: bytevector-sint-ref [small] (eval)
> FAIL: bytevectors.test: 2.3 Operations on Bytes and Octets: bytevector-sint-ref [small] (compile)

In the directory where you built using GCC-4.7.0 (SVN), can you please
apply the following 'patch for bytevectors.test' and then, from the
guile-2.0.5 directory, run:

  ./check-guile bytevectors.test

and show us the output?

This is a shot in the dark, but I've also attached a patch that _might_
fix the bytevector problem.  After applying it, it should be sufficient
to simply run "make" again, and it shouldn't take long.  Let us know!

     Thanks,
       Mark



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch for bytevectors.test (to help diagnose) --]
[-- Type: text/x-patch, Size: 1028 bytes --]

diff --git a/test-suite/tests/bytevectors.test b/test-suite/tests/bytevectors.test
index 3007434..b652935 100644
--- a/test-suite/tests/bytevectors.test
+++ b/test-suite/tests/bytevectors.test
@@ -114,10 +114,14 @@
               #xfffffffffffffffffffffffffffffffd)))
 
   (pass-if "bytevector-sint-ref [small]"
-    (let ((b (u8-list->bytevector '(#xff #xf0 #xff))))
-      (equal? (bytevector-sint-ref b 0 (endianness big) 2)
-              (bytevector-sint-ref b 1 (endianness little) 2)
-              -16)))
+    (let* ((b (u8-list->bytevector '(#xff #xf0 #xff)))
+           (be-result (bytevector-sint-ref b 0 (endianness big) 2))
+           (le-result (bytevector-sint-ref b 1 (endianness little) 2)))
+      (or (equal? be-result le-result -16)
+          (begin (format (current-error-port)
+                         "bytevector-sint-ref [small] failure: ~S ~S~%"
+                         be-result le-result)
+                 #f))))
 
   (pass-if "bytevector-sint-ref [large]"
     (let ((b (make-bytevector 50)))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: A shot in the dark (possible fix) --]
[-- Type: text/x-patch, Size: 1948 bytes --]

diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index fff5355..8574a36 100644
--- a/libguile/bytevectors.c
+++ b/libguile/bytevectors.c
@@ -103,7 +103,7 @@
                                                                 \
     memcpy (&c_result, &c_bv[c_index], (_len) / 8);             \
     if (!scm_is_eq (endianness, scm_i_native_endianness))       \
-      c_result = INT_SWAP (_len) (c_result);                    \
+      c_result = (INT_TYPE (_len, _sign)) INT_SWAP (_len) ((INT_TYPE (_len, unsigned)) c_result); \
                                                                 \
     result = SCM_I_MAKINUM (c_result);                          \
   }                                                             \
@@ -143,7 +143,7 @@
 								\
     c_value_short = (INT_TYPE (_len, _sign)) c_value;		\
     if (!scm_is_eq (endianness, scm_i_native_endianness))       \
-      c_value_short = INT_SWAP (_len) (c_value_short);		\
+      c_value_short = (INT_TYPE (_len, _sign)) INT_SWAP (_len) ((INT_TYPE (_len, unsigned)) c_value_short);  \
 								\
     memcpy (&c_bv[c_index], &c_value_short, (_len) / 8);	\
   }								\
@@ -918,7 +918,7 @@ bytevector_large_set (char *c_bv, size_t c_size, int signed_p,
 	    INT_TYPE (16, _sign)  c_value16;				\
 	    memcpy (&c_value16, c_bv, 2);				\
 	    if (swap)							\
-	      value = (INT_TYPE (16, _sign)) bswap_16 (c_value16);	\
+	      value = (INT_TYPE (16, _sign)) bswap_16 ((scm_t_uint16) c_value16); \
 	    else							\
 	      value = c_value16;					\
 	  }								\
@@ -981,7 +981,7 @@ bytevector_unsigned_ref (const char *c_bv, size_t c_size, SCM endianness)
 	      swap = !scm_is_eq (endianness, scm_i_native_endianness);	\
 									\
 	      if (swap)							\
-		c_value16 = (INT_TYPE (16, _sign)) bswap_16 (c_value);	\
+		c_value16 = (INT_TYPE (16, _sign)) bswap_16 ((scm_t_uint16) c_value); \
 	      else							\
 		c_value16 = c_value;					\
 									\

  reply	other threads:[~2012-02-01  1:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r4yg3l3e.fsf@gnu.org>
2012-01-31 14:21 ` bug#10681: GNU Guile 2.0.5 released Hans Aberg
2012-01-31 14:40   ` Andy Wingo
2012-01-31 15:04     ` Hans Aberg
2012-01-31 15:18   ` Ludovic Courtès
2012-01-31 16:59     ` Hans Aberg
2012-01-31 18:04   ` Mark H Weaver
2012-01-31 19:30     ` Hans Aberg
2012-01-31 19:35       ` Mark H Weaver
2012-01-31 19:41         ` Hans Aberg
2012-01-31 20:01         ` Hans Aberg
2012-01-31 22:02         ` Hans Aberg
2012-02-01  1:42           ` Mark H Weaver [this message]
2012-02-01  9:35             ` Hans Aberg
2012-02-01 14:14             ` Hans Aberg
2012-02-01  1:34         ` Hans Aberg
2012-02-01  1:49           ` Mark H Weaver
2012-02-01  9:18             ` Hans Aberg
2012-02-01 11:50               ` Andy Wingo
2012-02-01 13:36                 ` Hans Aberg
2012-02-01 14:53                   ` Andy Wingo
2012-02-01 15:08                     ` Hans Aberg
2012-07-06 18:23                       ` Andy Wingo
2012-07-07 12:03                         ` bug#10681: GNU Guile 2.0.6 released Hans Aberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqdze3c0.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=10681@debbugs.gnu.org \
    --cc=haberg-1@telia.com \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).