
2 May
2009
2 May
'09
12:57 p.m.
----- "Michal Trojnara" <[email protected]> wrote:
Miloslav Trmac wrote:
The attached patch changes the code not to access a part of a char[...] array using an int *, which is undefined in ISO C.
Casting pointers is undefined? No (as long as alignment restrictions are not violated), but accessing an object of one type via a pointer of other type is undefined for most combinations of the types.
Where did you find it? In the C standard :) Besides, GCC warns quite loudly.
http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html is a good description of the issue. Mirek