Unfortunately there's no standard way to get objects aligned like that. There's almost always some compiler-specific trick, such as __attribute__
in GCC, but you'll have to check your compiler's documentation.
(Of course there's no standard use for that kind of alignment either, which is why there's no standard method for achieving it. So you're probably resorting to extensions already, so there's no real harm going further.)
A union that contains a large-enough elemental object often does the trick, but I believe the largest elemental C objects for MIPS CPUs are long long
and double
, which are only 8 bytes.