By default, compiler will align to 32 or 64bit. And yes, there are compiler specific options that set alignment to a custom value.
So if you want to control alignment of struct fields, you can do that either with compiler flags or with pragmas.
With GCC that would be -fpack-struct=[n]
In source code, you can surround the definition of your struct with #pagma pack
or #pagma push(pack)
:
#pragma pack(push(n))
typedef struct my_struct {...} my_struct_t;
#pragma pack(pop)
GCC documentation: http://gcc.gnu.org/onlinedocs/gcc/Structure-Packing-Pragmas.html
MSDN documentation: http://msdn.microsoft.com/en-us/library/2e70t5y1.aspx