To be honest, my overall knowledge when it comes to the neurotic moodscape of various compilers is largely lacking. I've pretty much exclusively used VS thus far and barring a few quirks it's been pretty nice to me. Now, as I'm in the process of reorganizing large chunks of my entire codebase, however, I'd like to deal with some potentially less upfront portability issues. Basically, I have a handful of structures whose data fields are read directly from disk in chunks and to bypass serialization I want those to retain their field ordering under all circumstances for a given endianess. So far Googling has led me to the notion that it's, to quote StackOverflow, "a bit of a nightmare".
Is there a remotely portable way to enforce this? What compiler directives should I be looking at? My current target is Windows, but I'm taking considerable care with respect to dependencies to keep my code portable to Linux and OSX at some point. As far endianess goes, I want to maintain code integrity as is, but rebuild source data as needed.