Re: Being more anal about iospace accesses..

From: Nikita Danilov
Date: Wed Sep 15 2004 - 12:53:10 EST


Linus Torvalds writes:
>
>
> On Wed, 15 Sep 2004, JЖrn Engel wrote:
> >
> > C now supports pointer arithmetic with void*?
>
> C doesn't. gcc does. It's a documented extension, and it acts like if it
> was done on a byte.
>
> See gcc's user guide "Extension to the C Language Family".
>
> It's a singularly good feature.

Unfortunately it breaks even better identity

foo *p;

p + nr == (foo *)((char *)p + nr * sizeof *p)

unless one thinks that is --together with gcc-- that nothing occupies
exactly one byte.

>
> Linus

Nikita.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/