slang-users mailing list

[2012 Date Index] [2012 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] Slang sort test case failed on ARM


Hi:

Slang sort.sl test case failed on ARM architect.

# ./sltest sort.
Testing sorting ...Failed: simple sort: Char_Type [utf8=0]
./inc.sl:28:failed:Test Error
  Local variables for failed:
    String_Type s = "simple sort: Char_Type"
./sort.sl:27:test_simple_sort:Test Error
  Local variables for test_simple_sort:
    Integer_Type n = 2
    Integer_Type dir = 1
    Ref_Type cmp_op = &_op_lt
    Array_Type ishift = Integer_Type[2]
    Array_Type x = Char_Type[2]
    Array_Type dx = Double_Type[2]
    Undefined_Type bad = Undefined_Type
    DataType_Type type = Char_Type
./sort.sl:54:run_test_simple_sorts:Test Error
  Local variables for run_test_simple_sorts:
    String_Type method = "qsort"
./sort.sl:72:<top-level>:Test Error


The reason is that C type char means unsigned char on ARM architect,
which is signed on other architect often, S-lang is assuming it as
signed, so the sort.sl failed.
http://www.arm.linux.org.uk/docs/faqs/signedchar.php

So my suggestion is to change c type char as signed char mkslarith2.sl,
and reproduce slarith2.inc

---
 src/util/mkslarith2.sl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/src/util/mkslarith2.sl
+++ b/src/util/mkslarith2.sl
@@ -1,7 +1,7 @@
 #!/usr/bin/env slsh

 private variable CTypes =
-  ["char", "unsigned char", "short", "unsigned short", "int", "unsigned int",
+  ["signed char", "unsigned char", "short", "unsigned short", "int",
"unsigned int",
    "long", "unsigned long", "long long", "unsigned long long",
    "float", "double", "long double"];
 private variable Is_Int_Type =



Best regard
-Roy



[2012 date index] [2012 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]