Re: TreeStore behavior with -malign-double



Murray Cumming wrote:
On Tue, 2006-07-11 at 15:02 -0500, Bryan Silverthorn wrote:
To summarize: TreeStore columns with custom data types do not correctly store their values. I'm assuming that gtk+ and gtkmm were not compiled with -malign-double, and that the problem is therefore a direct result of the binary compatibility issues introduced by -malign-double.


That sounds very likely. In general you need to be very careful when
using compiler options. What's the purpose of this one for you?

In this case, it was one of the default flags applied by our build tool, and I removed it once I ran into this issue. My impression is that the flag is a fairly common optimization for modern x86 machines, but is never necessary, and can definitely cause binary incompatibility.

So it's not an issue that will block anyone's project (assuming that it's not, in fact, a library bug), but it's an easy-to-hit gotcha that can lead to silently incorrect library behavior. It might be nice if this incompatibility could be made more visible if present (eg, a warning printed by gtkmm init), but I'm not sure how. A quick glance at the gcc manual doesn't reveal any obvious way (eg, a macro) to test for the flag's presence.

Mostly, I just wanted to point out the issue for the benefit of future generations. And google.

--
Bryan Silverthorn <bsilvert cs utexas edu>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]