[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing C pointers through guile
From: |
Ludovic Courtès |
Subject: |
Re: Passing C pointers through guile |
Date: |
Fri, 11 Jul 2008 16:42:03 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Hi,
"Kjetil S. Matheussen" <address@hidden> writes:
> The code in question doesn't run on those platforms anyway,
> since there's a lot of strict linux stuff.
You are certainly aware that GNU/Linux *is* available on sparc64, alpha,
etc.
> However, I don't the storage of pointers in unsigned longs (which is a
> perfectly legal thing to do if done correctly), would pose any problem
> for running it on other hardware.
Again, it's not "perfectly legal", no matter whether you do it
"correctly" (whatever that means) or not: the C standard makes no
provision regarding the size of `long' versus the size of pointer types.
It happens to work on the mainstream platforms you're using, but it's
definitely not portable.
And I suppose that's the reason why you want `scm_{to,from}_uintptr ()'
in the first place, otherwise you'd just live (dangerously) with
`scm_{to,from}_unsigned_long ()'.
Thanks,
Ludovic.