zero-width bit-field

git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@4020 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
This commit is contained in:
kroening 2014-06-14 13:37:43 +00:00
parent 9a528e2820
commit 2e2c52d62d
1 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,15 @@ struct S2
STATIC_ASSERT(sizeof(struct S2)==sizeof(char));
struct S3
{
char my_bit : 1;
int : 0; // zero width, causes padding to alignment of int
char other;
};
STATIC_ASSERT(sizeof(struct S3)==sizeof(int)+sizeof(char));
int main()
{
}