<div dir="ltr">Hi,<div><br></div><div>I am wondering how I can tell whether a field of a struct is introduced by padding or not.</div><div><br></div><div>For example, if I have a struct:</div><br>struct foo1 {<br>    char *p;     /* 8 bytes */<br>    char c;      /* 1 byte<br>    long x;      /* 8 bytes */<br>};<div><br></div><div>clang may generate:</div><br>struct foo1 {<br>    char *p;     /* 8 bytes */<br>    char c;      /* 1 byte<br>    char pad[7]; /* 7 bytes */<br>    long x;      /* 8 bytes */<br>};<div><br></div><div>Is there any way that I can tell the "pad" array is generated by padding?</div><div><br></div><div>Thanks a lot</div><div>Hongbin</div></div>