This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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.
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.
-- Michael hennebry@web.cs.ndsu.NoDak.edu "Pessimist: The glass is half empty. Optimist: The glass is half full. Engineer: The glass is twice as big as it needs to be."
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |