I'm currently defining a struct in C (in Ubuntu x64). It looks like this:
#include <semaphore.h>
#include <stdio.h>
#include <stdbool.h>
typedef struct key{
sem_t sem;
char name[32];
int val1;
int val2;
char k;
int n;
} Key;
From what I know (correct me if wrong, please), struct members in x64 will align to 8 bytes and in x32 will align with 4 bytes. That's also the reason I chose 32 as the id array size.
What I wanted to know is: as it is (first member being a sem_t (32 bytes apparently), and next members being that or any other thing) will there be any padding between the first (sem) and the second member (name, in this case)? Or are they contiguous? If so, does this hold true for both x32 and x64 (as 32 bytes is a multiple of both 4 and 8 bytes)?