On Tuesday, 22. January 2002 01:54, Ellis Whitehead wrote: > Would the following cast from an int to a struct cause problems on any > systems? > > struct A { > int a; > int x(); > }; > > int foo() { > int b = 0; > return ((A*)(&b))->x(); > } > > I have a couple classes related to kdelibs/kdecore/kkey* that contain only > a single 'int' of data. I would like to keep them private and put 'int's > in the containing class definition. I'm just guessing from what I've been able to figure out so far, but I think such evil casts indicate a design flaw. Right now you can break binary compatibility to resolve such stuff, perhaps it's worth a try. Such code as the above is IMHO way too fragile to be used anywhere else but in testcases. - Frerich >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<