[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some 64bit issues.
From: |
Dirk Herrmann |
Subject: |
Re: Some 64bit issues. |
Date: |
Mon, 17 Sep 2001 21:50:20 +0200 (MEST) |
On Mon, 17 Sep 2001, Rob Browning wrote:
> Also, instead of fixing every call, I changed SCM_MAKE_CHAR to coerce
> it's arg, x, to an intptr_t. This fixes all the warnings and some
> bugs, but is it more appropriate to add a coercion at the point of
> use? i.e. I'm wondering if this global coercion, in the macro, might
> mask other errors. I haven't thought about this at all yet, so the
> answer may be obvious...
To me it seems OK to do it in SCM_MAKE_CHAR. To do it at the point of use
is not a good idea, IMO, since I would see it as an implementation detail
which type is used internally for guile's chars. We should, however,
guarantee that SCM_MAKE_CHAR works for char and int parameters.
> There are also a number of places in the code where the string
> handling does things like
>
> int k = SCM_STRING_LENGTH(foo);
>
> Is this OK? What happens if someone with 8GB of RAM wants to create a
> giant string? I guess the real question is, what code guidelines do
> we want for the types that should be used for things like string
> indexes, etc., on the C side.
The code line that you give as an example is not OK. I think (better:
hope to remember correctly) that we decided to use size_t for the lengths
of strings.
Best regards,
Dirk Herrmann