Skip to content

Commit d0d575a

Browse files
authored
bpo-29939: suppress compiler warnings in _ctypes_test (#1038)
bpo-29939: Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler. (cherry picked from commit 164d30e)
1 parent 616d3eb commit d0d575a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/_ctypes/_ctypes_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ _testfunc_cbk_large_struct(Test in, void (*func)(Test))
5252
EXPORT(void)
5353
_testfunc_large_struct_update_value(Test in)
5454
{
55-
in.first = 0x0badf00d;
56-
in.second = 0x0badf00d;
57-
in.third = 0x0badf00d;
55+
((volatile Test *)&in)->first = 0x0badf00d;
56+
((volatile Test *)&in)->second = 0x0badf00d;
57+
((volatile Test *)&in)->third = 0x0badf00d;
5858
}
5959

6060
EXPORT(void)testfunc_array(int values[4])

0 commit comments

Comments
 (0)