Is the a amount of padding in C struct well defined in standards or compiler and/or target architecture dependent. I could not find an answer in the standards.
Is the a amount of padding in C struct well defined in standards or
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is implementation-defined. From section 6.7.2.1 of the C99 standard:
The compiler will typically choose an arrangement that suits the underlying hardware (aligning things to be easy to read from memory, etc.).