This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c/13421] IA32 bigmem pointer subtraction and –ftrapv option causes unjustified program abort


------- Additional Comments From vik dot heyndrickx at pandora dot be  2003-12-18 12:21 -------
(In reply to comment #10)
> Just as a sidenote: the integer type that can hold pointers is, at 
> least in C++, ptrdiff_t. Casting to this type should get you where 
> you want. 

No, it won't. ptrdiff_t exists also in C by the way. The problem is not the 
result of the subtraction but the subtraction itself. 
In essence the problem is the signedness of pointers. Later on, I realizes that 
when p is a pointer, and q is set to e.g. p + 2, that q < p for some values of 
p (e.g. (void*)0x7FFFFFFFu) on IA32. Signedness and an addressible flat memory 
space larger than 2^31 are not compatible.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13421


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]