summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2017-04-07 22:24:51 (GMT)
committerGitHub <noreply@github.com>2017-04-07 22:24:51 (GMT)
commitae0915e42d8cd96e5ced1fc442ea078b4a59e82d (patch)
tree04dc753cde8f5934b12bcf126b641230acbf6fbf
parentf688f180b21679c06d5258e88c688635ed719473 (diff)
downloadcpython-ae0915e42d8cd96e5ced1fc442ea078b4a59e82d.zip
cpython-ae0915e42d8cd96e5ced1fc442ea078b4a59e82d.tar.gz
cpython-ae0915e42d8cd96e5ced1fc442ea078b4a59e82d.tar.bz2
Closes bpo-29939: suppress compiler warnings in _ctypes_test (#1039)
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)
-rw-r--r--Modules/_ctypes/_ctypes_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
index 20e65d2..e3240c5 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])