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:
William S Fulton 2005-05-13 23:14:35 +00:00
commit 94e6c86d06
6 changed files with 33 additions and 24 deletions

View file

@ -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);