This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: New testcase
- To: David Korn <dkorn at pixelpower dot com>
- Subject: Re: New testcase
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Tue, 14 Nov 2000 15:41:51 +0000
- Cc: gcc-patches at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
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.