[plt-scheme] Cooperating with 3m

From: Chongkai Zhu (u0476504 at utah.edu)
Date: Mon Jan 2 22:59:52 EST 2006

Thank you for the answer.

======= At 2006-01-02, 18:46:35 Matthew Flatt wrote: =======

>> 3. When compiling, I got the following error message:
>> 
>> Error [ARITH] 53 in ml.c: suspicious arithmetic, LHS ends arg.
>> 
>> line 53 is 
>> 
>> 	if (lp == (MLINK)0)
>> 
>> lp is a variable previously defined as:
>> 	MLINK lp;
>> 
>> The reason of the error is mentioned in <3.1.3  Local Pointers and mzc>. 
>> Could anyone help to change my code so that I can avoid the error?
>
>I suspect that xform is confused about the line, since I don't see how
>`arg' could be in the expansion of this code. Do you see an `arg'
>anywhere with an arithmetic operation?

Yes. The previous line (line 52) contains an expression

	arg+(argc+1)

The data type is

	int argc;
	char **arg;

And arg contains strings only used in C (command line arguments).
Could you please improve the heuristic to support the addition 
of an address and an integer? Or must I rewrite the expression to
something such as

	(char**)((unsigned int)arg+(argc+1)*sizeof(char*))

?

>
>Matthew
>
Chongkai



Posted on the users mailing list.