g++ struct mapping change
I just installed Version 10.4 lucid lynx, and ALL of my programs no longer work. After chasing this for 3 days, we found out that g++ now maps structures differently than Jaunty or Karmic. Try this test: Make a struct with a char, a double, another char, and antoher double, in that order. WIth Januty and Karmic, the structures are only 24 bytes. With Lucid, they are 32, and the offsets of the doubles moved. It looks like Lucid now maps the doubles onto offsets divisible by 8 rather than by 4 like it used to. The result is total chaos, and no way to read our data.
We have stopped deployment of Lucid cold until we find a way out of this. Any struct that has doubles in it mixed with other data types will have this problem. One workaround we can't try (we have a lot of legacy data) is to put the doubles first, then floats and ints, then chars, but this can only be done with new code, assuming it makes sense to do this.
The operating system is Ubuntu 64 bit in all cases on PCs.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- David R. Doucette
- Solved:
- Last query:
- Last reply: