[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Getting the callers environment in c
- From: Sam Roberts <vieuxtech@...>
- Date: Tue, 8 Mar 2011 11:41:10 -0800
On Tue, Mar 8, 2011 at 11:30 AM, liam mail <firstname.lastname@example.org> wrote:
> Just a note to say that a function pointer and void pointer have
> no guarantees to be the same size.
If that is an issue for the OP, don't use lightuserdata, an alternate
technique is to use the fn ptr value encoded as a hex string.
While ANSI allows sizeof(void (*)()) to be > sizeof(void*), its pretty
unusual (I've never seen it). IIRC, traditional/pre-ANSI C required
any ptr, including functions pointers, to be castable to void* without