PATCH: BPs & cleanups for ARRAY_SIZE
Wed Aug 23 16:11:00 GMT 2000
Greg McGary <email@example.com> writes:
> Raja R Harinath <firstname.lastname@example.org> writes:
> > Why is this necessary? The compiler already has all the information
> > for
> > ap = (int *) a;
> > to do what the macro does. The exact same intent is expressed: I want
> > to treat a multidimensional array as a single-dimensional array.
> Not exactly. `ap = (int *) a' is equivalent to `ap = (int *) &a'
> and a is int, not int.
My reasoning here is flawed. Consider this:
char *s = a;
By the above argument, `s = a' is equivalent to `s = &a' and a
is char, not char, so the only valid access is to s, with
s..s being invalid. That argument is clearly wrong in this
context, and not what BPs do in this case.
More information about the Gcc-patches