Fixes to remove "dereferencing type-punned pointer will break strict-aliasing rules" warnings in C wrappers when compiling C code with 'gcc -Wall -fstrict-aliasing'. Patch from Michael Cahill.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7192 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9bd7f1ec9a
commit
94e6c86d06
6 changed files with 33 additions and 24 deletions
|
|
@ -35,7 +35,7 @@ JNIEXPORT jstring JNICALL Java_exampleJNI_point_1toString2(JNIEnv *jenv, jclass
|
|||
|
||||
(void)jcls;
|
||||
|
||||
p = *(Point **)&jpoint;
|
||||
p = *(Point **)(void *)&jpoint;
|
||||
sprintf(buf, "[%d,%d]", p->x, p->y);
|
||||
|
||||
result = (*jenv)->NewStringUTF(jenv, buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue