diff options
author | Benjamin Peterson <benjamin@python.org> | 2017-03-31 11:05:25 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-03-31 11:05:25 (GMT) |
commit | 164d30eb1e66575dafee6af4fca4cbf52c7fbe6a (patch) | |
tree | daf12b5a16de81d113e5592dda7fc34185a5c8e2 | |
parent | cdcac039fb447f2ab04efcacbe663751bb2cb4ec (diff) | |
download | cpython-164d30eb1e66575dafee6af4fca4cbf52c7fbe6a.zip cpython-164d30eb1e66575dafee6af4fca4cbf52c7fbe6a.tar.gz cpython-164d30eb1e66575dafee6af4fca4cbf52c7fbe6a.tar.bz2 |
suppress compiler warnings in _ctypes_test (#902)
Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler.
-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 9410c7f..fe0015c 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]) |