Re: ANSI C clarifications, with citations (was Re: [patch-2.4

Larry McVoy (lm@bitmover.com)
Tue, 27 Jun 2000 11:44:53 -0700


> > Cast a char * to int * on any architecture with strong alignmenmt
> > restrictions and watch your code commit messy suicide.
>
> No. It is "cast a char * to int * _and_dereference_it_". He never
> told about dereferencing. Freely casting between different pointers
> types works perfectly on most if not all modern[1] architectures

Agreed, but if you are laying down guidelines about what is portable
don't you think it should have read "cast any pointer to any pointer **but
derefencing the pointer may not work**"? The point is that people will
take those statements at face value and they are hardly the guidelines
that you should be advertising. At least that's my point.

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