This is the mail archive of the gcc-patches@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]

Re: New testcase



Well, I only have a c9x draft to hand, but it says (6.5.6 Additive 
operators):

9 When two pointers are subtracted, both shall point to elements of the 
same array object, or one past the last element of the array object; the 
result is the difference of the subscripts of the two array elements.

Which means, of course, that an implementation on a segmented memory 
architecture could, if it wished, put each object in a separate segment.  
It could then fault any attempt to subtract pointers where the segment 
pointers were different.

>   I'd have to look this up. I thought there was an exclusion for char
> types, or possibly only unsigned char. You're allowed to do all sorts
> of things with char pointers that aren't permitted with other types, and
> the standard also makes guarantees about the underlying representability
> of objects as arrays of unsigned char... I'd have to look it up.
> 
>  BTW, owing to ORBS problems this reply won't make it to the list. You
> could Fw: it if you think it would be worthwhile.

R.


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