I'm trying to build a struct that holds various fields, of varying size. Since I'd like to also compute an HMAC over the concatenated fields I thought it might be nice to just be able to pass a pointer to the struct instance to the HMAC function. However, I'm fearing that some compilers may add padding to between the struct fields, which would lead to inconsistent HMAC results.
Is there a portable way to ensure that the compiler does not add padding between the fields?