On Fri, 10 Mar 2006, Guochun Shi wrote: > [...] > I don't understand the cause of the problem. GSource.c:239: > ret->detecttime = zero_longclock; > where detecttime is "longclock_t", and zero_longclock is "const > longclock_t". They should have the same size > and same allignment, no matter what arch it is > > anyone enlighten me please?
It is the casting that is going on in the code. The main manipulation of it is done on a version which doesn't include one of these enormously long "longclock_t" fields. Suddenly, that comes into play, so the compiler warns that the alignment that it has been using so far (as directed ultimately by the programmer) may be now insufficient. This will affect all computer chip architectures for which alignment is important (those of us old enough to remember IBM 360 will recognise it!) including sparc. Compilers for such chips always (except for compiler bugs!) get things right for code that is clean: no problem. But casts immediately make the code "unclean". "Casts considered harmful" etc. A bit like leaping into a parachute jump, then realising you hadn't attached the parachute to yourself. See bugzilla: http://www.osdl.org/developer_bugzilla/show_bug.cgi?id=1114 Hope that helps. -- : David Lee I.T. Service : : Senior Systems Programmer Computer Centre : : Durham University : : http://www.dur.ac.uk/t.d.lee/ South Road : : Durham DH1 3LE : : Phone: +44 191 334 2752 U.K. : _______________________________________________________ Linux-HA-Dev: [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
