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

Re: C99 conformance bug in gcc-3.1


On Thu, May 30, 2002 at 03:06:55PM +0300, Momchil Velikov wrote:
> 
> Is the following equality required by the standard:
> 
> struct foo a[DIM];
> 
> (char *) &a[i] == (char *) &a[i-1] + sizeof (struct foo) ?

Yes, although the only place that I can find which clearly says
so is footnote 79. Apart from that, pointer arithmetic appears
to be defined in a rather circular manner, although you can sort
of infer the contents of footnote 79 from footnote 82 (I can't
find anywhere else that says array elements are adjacent).

Tony.
-- 
f.a.n.finch <dot@dotat.at> http://dotat.at/
MALIN HEBRIDES: SOUTHWESTERLY 5 OR 6. SQUALLY SHOWERS. GOOD.


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