Package: zinc-compiler
Severity: normal
Tags: patch
When building 'zinc-compiler' on amd64 with gcc-4.0,
I get the following error:
gc_2space.nw:280: warning: cast to pointer from integer of different size
gc_2space.nw:280: error: invalid lvalue in assignment
gc_2space.nw:280: warning: cast from pointer to integer of different size
gc_2space.nw:280: error: invalid lvalue in assignment
gc_2space.nw:301: warning: cast from pointer to integer of different size
gc_2space.nw:306: warning: cast to pointer from integer of different size
gc_2space.nw:306: warning: cast from pointer to integer of different size
gc_2space.nw:316: warning: cast to pointer from integer of different size
gc_2space.nw:316: warning: cast from pointer to integer of different size
gc_2space.nw:330: warning: cast to pointer from integer of different size
gc_2space.nw:330: warning: cast from pointer to integer of different size
gc_2space.nw:363: warning: cast to pointer from integer of different size
gc_2space.nw:349: warning: cast to pointer from integer of different size
make[3]: *** [libcurry_rts_a-gc_2space.o] Error 1
make[3]: Leaving directory `/zinc-compiler-1.0.2/runtime'
With the attached patch 'zinc-compiler' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/zinc-compiler-1.0.2/runtime/gc_2space.c
./runtime/gc_2space.c
--- ../tmp-orig/zinc-compiler-1.0.2/runtime/gc_2space.c 2004-12-06
19:28:57.000000000 +0100
+++ ./runtime/gc_2space.c 2005-03-20 08:47:40.000000000 +0100
@@ -133,7 +133,7 @@
while ( --scan >= (Node **)(cp + 1) )
GC_copy(*scan);
- GC_copy((Node *)cp->btRq);
+ Node *n = (Node *)cp->btRq; GC_copy(n); cp->btRq = n;
next_cp = cp->btBp;
cp->btBp = prev_cp;
@@ -149,18 +149,20 @@
for ( scan_trail = trail_base; scan_trail != tp; scan_trail++ )
{
- GC_copy((Node *)scan_trail->addr);
- GC_copy((Node *)scan_trail->val);
+ Node *n;
+ n = (Node *)scan_trail->addr; GC_copy(n); scan_trail->addr =n;
+ n = (Node *)scan_trail->val; GC_copy(n); scan_trail->val =n;
}
}
-#line 279 "gc_2space.nw"
-GC_copy((Node *)rq);
-GC_copy((Node *)ss);
+#line 280 "gc_2space.nw"
+Node *n;
+n = (Node *)rq; GC_copy(n); rq = n;
+n = (Node *)ss; GC_copy(n); ss = n;
#line 145 "gc_2space.nw"
-#line 288 "gc_2space.nw"
+#line 290 "gc_2space.nw"
for ( scan = (Node **)to_space; scan != copy; scan += len )
{
boolean is_vect;
@@ -213,7 +215,7 @@
#line 146 "gc_2space.nw"
-#line 361 "gc_2space.nw"
+#line 363 "gc_2space.nw"
for ( dict = names_dict; dict != (struct dict_node *)0; dict = dict->next )
if ( is_forwarded(dict->node) )
dict->node = get_forward(dict->node);
@@ -222,7 +224,7 @@
#line 147 "gc_2space.nw"
-#line 347 "gc_2space.nw"
+#line 349 "gc_2space.nw"
for ( i = j = 0; i < n_finals; i++ )
if ( is_forwarded(finals[i]) )
finals[j++] = get_forward(finals[i]);
@@ -256,7 +258,7 @@
stats_end_gc(hp - heap_base);
}
-#line 382 "gc_2space.nw"
+#line 384 "gc_2space.nw"
void
release_mem()
{
diff -urN ../tmp-orig/zinc-compiler-1.0.2/runtime/gc_2space.nw
./runtime/gc_2space.nw
--- ../tmp-orig/zinc-compiler-1.0.2/runtime/gc_2space.nw 2003-12-01
20:55:10.000000000 +0100
+++ ./runtime/gc_2space.nw 2005-03-20 08:47:39.000000000 +0100
@@ -247,7 +247,7 @@
while ( --scan >= (Node **)(cp + 1) )
GC_copy(*scan);
- GC_copy((Node *)cp->btRq);
+ Node *n = (Node *)cp->btRq; GC_copy(n); cp->btRq = n;
next_cp = cp->btBp;
cp->btBp = prev_cp;
@@ -267,8 +267,9 @@
for ( scan_trail = trail_base; scan_trail != tp; scan_trail++ )
{
- GC_copy((Node *)scan_trail->addr);
- GC_copy((Node *)scan_trail->val);
+ Node *n;
+ n = (Node *)scan_trail->addr; GC_copy(n); scan_trail->addr =n;
+ n = (Node *)scan_trail->val; GC_copy(n); scan_trail->val =n;
}
}
@@ -276,8 +277,9 @@
Finally, the current search space and ready queue are also roots.
<<Copy all roots into to-space>>=
-GC_copy((Node *)rq);
-GC_copy((Node *)ss);
+Node *n;
+n = (Node *)rq; GC_copy(n); rq = n;
+n = (Node *)ss; GC_copy(n); ss = n;
@
After all roots have been processed, the nodes in to-space now form a
diff -urN ../tmp-orig/zinc-compiler-1.0.2/runtime/spaces.c ./runtime/spaces.c
--- ../tmp-orig/zinc-compiler-1.0.2/runtime/spaces.c 2004-12-06
19:28:57.000000000 +0100
+++ ./runtime/spaces.c 2005-03-20 10:22:33.717167502 +0100
@@ -396,7 +396,7 @@
copy = copy_node(graph, space);
/* copy all children */
- for ( scan = (Node *)hp; scan < (Node *)alloc; (Node **)scan += sz )
+ for ( scan = (Node *)hp; scan < (Node *)alloc; scan = (Node **)scan + sz )
{
unsigned int i, n;
ThreadQueue tq;
diff -urN ../tmp-orig/zinc-compiler-1.0.2/runtime/spaces.nw ./runtime/spaces.nw
--- ../tmp-orig/zinc-compiler-1.0.2/runtime/spaces.nw 2003-12-01
20:55:26.000000000 +0100
+++ ./runtime/spaces.nw 2005-03-20 10:22:32.657374296 +0100
@@ -603,7 +603,7 @@
copy = copy_node(graph, space);
/* copy all children */
- for ( scan = (Node *)hp; scan < (Node *)alloc; (Node **)scan += sz )
+ for ( scan = (Node *)hp; scan < (Node *)alloc; scan = (Node **)scan + sz )
{
unsigned int i, n;
ThreadQueue tq;
diff -urN ../tmp-orig/zinc-compiler-1.0.2/runtime/threads.c ./runtime/threads.c
--- ../tmp-orig/zinc-compiler-1.0.2/runtime/threads.c 2004-12-06
19:28:57.000000000 +0100
+++ ./runtime/threads.c 2005-03-20 10:22:07.060369125 +0100
@@ -176,7 +176,7 @@
#define thd1 (ThreadQueue)LOCAL_ROOT[1]
ASSERT(is_boxed(var) && is_variable_node(var));
- thd1 = interrupt_thread(l, Yield);
+ LOCAL_ROOT[1] = interrupt_thread(l, Yield);
CHECK_HEAP(2*thread_surrogate_size);
SAVE(var, v.wq);
diff -urN ../tmp-orig/zinc-compiler-1.0.2/runtime/threads.nw
./runtime/threads.nw
--- ../tmp-orig/zinc-compiler-1.0.2/runtime/threads.nw 2003-12-01
20:55:31.000000000 +0100
+++ ./runtime/threads.nw 2005-03-20 10:22:06.008574372 +0100
@@ -366,7 +366,7 @@
#define thd1 (ThreadQueue)LOCAL_ROOT[1]
ASSERT(is_boxed(var) && is_variable_node(var));
- thd1 = interrupt_thread(l, Yield);
+ LOCAL_ROOT[1] = interrupt_thread(l, Yield);
CHECK_HEAP(2*thread_surrogate_size);
SAVE(var, v.wq);
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]