Visual Studio differs!

git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@5135 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
This commit is contained in:
kroening 2015-02-01 11:41:01 +00:00
parent 005ad48b8c
commit eddacd85db
1 changed files with 7 additions and 3 deletions

View File

@ -41,11 +41,15 @@ STATIC_ASSERT(sizeof(union some_union3)==sizeof(int));
#ifdef _MSC_VER
// bit-fields are evil
__declspec(align(packed)) union some_union4
#pragma pack(1)
union some_union4
{
int i:23;
};
// Visual Studio ignores the 'packed'
STATIC_ASSERT(sizeof(union some_union4)==sizeof(int));
#else
// bit-fields are evil
@ -54,10 +58,10 @@ union some_union4
int i:23;
} __attribute__((__packed__));
#endif
STATIC_ASSERT(sizeof(union some_union4)==3);
#endif
int main()
{
}