[plt-scheme] mzc question

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Sun Mar 2 20:55:35 EST 2008

According to chapter 3.1.3 of "Inside PLT MzScheme":

the --xform mode for mzc does not handle all of C. It's ability to 
rearrange compound expressions is particularly limited, because --xform 
merely converts expression text heuristically instead of parsing C. A 
future version of the tool will correct such problems. For now, mzc in 
--xform mode attempts to provide reasonable error messages when it is 
unable to convert a program, but beware that it can miss cases.

For this part of code you posted, neither 
scheme_char_string_to_byte_string  nor SCHEME_BYTE_STR_VAL  will trig 
GC, so you can just use XFORM_HIDE_EXPR to hide it from xfrom.


tom sgouros wrote:
> Hello all:
> Mzc gives me this error.  What is it trying to tell me?
> $ make
> mzc --xform sserial.c
> mzc v370 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
> Error [CALL] 550 in sserial.c: Bad place for function call, starting tok
> is scheme_char_string_to_byte_string.
> xform: Errors converting
> The offending piece of code is this:
>     if (SCHEME_CHAR_STRINGP(argv[1])) {
>       printf("Waiting to start: %s\n",
>            SCHEME_BYTE_STR_VAL(scheme_char_string_to_byte_string(argv[1])));
> I wouldn't be at all surprised to learn that I'm still not getting the
> byte string/char string/UCS-4/UTF-8 business correct, but that doesn't
> seem to be what mzc is complaining about.
> How can I fix this?
> Many thanks,
>  -tom

Posted on the users mailing list.