Hello,
attached there are two small patches for chicken-5.
The former patch is just to make fxshr behave consistently with fxshl
by casting the shift count to an unsigned word, the compiler is
probably going to complain anyway because the shift count is greater
than the size of the type but at least now the behaviour is
symmetrical.
The latter patch is just a minor rewording of a confusing error
message, I stumbled across it while modifying some code in the
scrutinizer and had accidentally mistyped a symbol name. Since the
whole compiler is built with the warnings disabled all I got was a
"module unresolved" error which in hindsight isn't very informative
nor particularly right (it's not the module that is undefined, it's a
symbol used in the body).

Thanks for your time,
LemonBoy
From eca725518e78fe88ea43c5a88e757d2db552815d Mon Sep 17 00:00:00 2001
From: LemonBoy <thatle...@gmail.com>
Date: Mon, 2 May 2016 20:41:51 +0200
Subject: [PATCH 1/2] Convert the shift count to a unsigned word for fxshr
To: chicken-hackers@nongnu.org

Make it behave consistently with regards to fxshl.
---
 chicken.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chicken.h b/chicken.h
index ccaa092..0bfd5fd 100644
--- a/chicken.h
+++ b/chicken.h
@@ -1225,7 +1225,7 @@ typedef void (C_ccall *C_proc)(C_word, C_word *) C_noret;
 #define C_fixnum_xor(n1, n2)            (((n1) ^ (n2)) | C_FIXNUM_BIT)
 #define C_fixnum_not(n)                 ((~(n)) | C_FIXNUM_BIT)
 #define C_fixnum_shift_left(n1, n2)     (C_fix(((C_uword)C_unfix(n1) << (C_uword)C_unfix(n2))))
-#define C_fixnum_shift_right(n1, n2)    (((n1) >> C_unfix(n2)) | C_FIXNUM_BIT)
+#define C_fixnum_shift_right(n1, n2)    (((n1) >> (C_uword)C_unfix(n2)) | C_FIXNUM_BIT)
 /* XXX TODO OBSOLETE, but still used by C_fixnum_negate, which is fxneg */
 #define C_u_fixnum_negate(n)            (-(n) + 2 * C_FIXNUM_BIT)
 #define C_fixnum_negate(n)              (C_u_fixnum_negate(n) | C_FIXNUM_BIT)
-- 
2.8.2

From b4a9edc60cb6f276c2ff476225fc00be29252048 Mon Sep 17 00:00:00 2001
From: LemonBoy <thatle...@gmail.com>
Date: Mon, 2 May 2016 20:46:48 +0200
Subject: [PATCH 2/2] Reword an error message
To: chicken-hackers@nongnu.org

The error is raised when the code inside a module references an
undefined symbol, "module unresolved" doesn't tell much.
---
 modules.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules.scm b/modules.scm
index 6fcd1be..ca410da 100644
--- a/modules.scm
+++ b/modules.scm
@@ -514,7 +514,7 @@
 		 (##sys#warn (get-output-string out))))))
 	 (module-undefined-list mod))
 	(when missing
-	  (##sys#error "module unresolved" name))
+	  (##sys#error "undefined symbols in module body" name))
 	(let* ((iexports 
 		(map (lambda (exp)
 		       (cond ((symbol? (cdr exp)) exp)
-- 
2.8.2

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to