This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: patches for Irix binutils 2.18 -- removal of some casts
> Date: Thu, 23 Oct 2008 22:50:38 +0100
> From: macro
> To: jay
> CC: hennebry; amodra; binutils
>
> On Thu, 23 Oct 2008, Jay wrote:
>
>> I mean, you know, I wonder, in the absence of widespread C99 support,
>> what to store pointers in if I really want an integer, and later back to
>> a pointer, with no loss. Long is not it, it is wrong on Win64.
>
> Use a union of the types you are interested in. You avoid all the
> aliasing problems this way too. And reasonable ABIs pass small unions
> around in registers so no run-time penalty.
>
> Maciej
I think that's different. I want to do "direct pointer math", possibly. Not an integer/pointer union, but an integer that can hold a pointer losslessly.
char* is almost the type I want -- since you can add/subtract integers to/from it, and actually I really like that gcc lets you do math on void*, but unfortunately other compilers don't.
- Jay