File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ test_script:
7070 rmdir /s /q ansi-c\arch_flags_mthumb_good
7171 rmdir /s /q ansi-c\Forward_Declaration2
7272 rmdir /s /q ansi-c\Incomplete_Type1
73- rmdir /s /q ansi-c\Union_Padding1
7473 rmdir /s /q ansi-c\Universal_characters1
7574 rmdir /s /q ansi-c\function_return1
7675 rmdir /s /q ansi-c\gcc_attributes7
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ phases:
3434 Remove-Item ansi-c\arch_flags_mthumb_good -Force -Recurse
3535 Remove-Item ansi-c\Forward_Declaration2 -Force -Recurse
3636 Remove-Item ansi-c\Incomplete_Type1 -Force -Recurse
37- Remove-Item ansi-c\Union_Padding1 -Force -Recurse
3837 Remove-Item ansi-c\Universal_characters1 -Force -Recurse
3938 Remove-Item ansi-c\function_return1 -Force -Recurse
4039 Remove-Item ansi-c\gcc_attributes7 -Force -Recurse
Original file line number Diff line number Diff line change @@ -927,7 +927,13 @@ void c_typecheck_baset::typecheck_compound_body(
927927 if (type.id ()==ID_struct)
928928 add_padding (to_struct_type (type), *this );
929929 else if (type.id ()==ID_union)
930+ {
931+ // Visual Studio ignores padding on unions
932+ if (config.ansi_c .mode == configt::ansi_ct::flavourt::VISUAL_STUDIO)
933+ type.remove (ID_C_packed);
934+
930935 add_padding (to_union_type (type), *this );
936+ }
931937
932938 // Now remove zero-width bit-fields, these are just
933939 // for adjusting alignment.
You can’t perform that action at this time.
0 commit comments