diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-04-07 22:23:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 22:23:08 (GMT) |
commit | d0d575a6db8cb3b2a720be9f404af3d754da9a5d (patch) | |
tree | e9f325bc80460d549a10296277646187f565d17d /Modules | |
parent | 616d3eb7ef96f1a27bbff68fba6e5d229257d936 (diff) | |
download | cpython-d0d575a6db8cb3b2a720be9f404af3d754da9a5d.zip cpython-d0d575a6db8cb3b2a720be9f404af3d754da9a5d.tar.gz cpython-d0d575a6db8cb3b2a720be9f404af3d754da9a5d.tar.bz2 |
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 164d30eb1e66575dafee6af4fca4cbf52c7fbe6a)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/_ctypes_test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c index 59d56d0..6119ecd 100644 --- a/Modules/_ctypes/_ctypes_test.c +++ b/Modules/_ctypes/_ctypes_test.c @@ -52,9 +52,9 @@ _testfunc_cbk_large_struct(Test in, void (*func)(Test)) EXPORT(void) _testfunc_large_struct_update_value(Test in) { - in.first = 0x0badf00d; - in.second = 0x0badf00d; - in.third = 0x0badf00d; + ((volatile Test *)&in)->first = 0x0badf00d; + ((volatile Test *)&in)->second = 0x0badf00d; + ((volatile Test *)&in)->third = 0x0badf00d; } EXPORT(void)testfunc_array(int values[4]) |