File tree 3 files changed +6
-2
lines changed 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ test_script:
70
70
rmdir /s /q ansi-c\arch_flags_mthumb_good
71
71
rmdir /s /q ansi-c\Forward_Declaration2
72
72
rmdir /s /q ansi-c\Incomplete_Type1
73
- rmdir /s /q ansi-c\Union_Padding1
74
73
rmdir /s /q ansi-c\Universal_characters1
75
74
rmdir /s /q ansi-c\function_return1
76
75
rmdir /s /q ansi-c\gcc_attributes7
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ phases:
34
34
Remove-Item ansi-c\arch_flags_mthumb_good -Force -Recurse
35
35
Remove-Item ansi-c\Forward_Declaration2 -Force -Recurse
36
36
Remove-Item ansi-c\Incomplete_Type1 -Force -Recurse
37
- Remove-Item ansi-c\Union_Padding1 -Force -Recurse
38
37
Remove-Item ansi-c\Universal_characters1 -Force -Recurse
39
38
Remove-Item ansi-c\function_return1 -Force -Recurse
40
39
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(
927
927
if (type.id ()==ID_struct)
928
928
add_padding (to_struct_type (type), *this );
929
929
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
+
930
935
add_padding (to_union_type (type), *this );
936
+ }
931
937
932
938
// Now remove zero-width bit-fields, these are just
933
939
// for adjusting alignment.
You can’t perform that action at this time.
0 commit comments