Please review a fix for 8007748: MacOSX build error : cast of type 'SEL' to 'uintptr_t' (aka 'unsigned long') is deprecated; use sel_getName instead

Phil Race philip.race at oracle.com
Fri Feb 8 14:10:12 PST 2013


People building with the latest xcode seem to be hitting the error in 
the subject line.
I think the error message is misleading about the solution and I propose 
the fix below.
Does it look OK ?
I'm not really sure where to send this for review but I think the porting
alias is likely to have more people who would know what is right than
any of the other lists.

Here's a pointer to the full bug
http://bugs.sun.com/view_bug.do?bug_id=8007748

diff --git a/src/macosx/native/jobjc/src/core/native/SEL.m 
b/src/macosx/native/jobjc/src/core/native/SEL.m
--- a/src/macosx/native/jobjc/src/core/native/SEL.m
+++ b/src/macosx/native/jobjc/src/core/native/SEL.m
@@ -34,7 +34,7 @@
      const char *selNameAsChars = (*env)->GetStringUTFChars(env, 
selName, JNI_FALSE);
      const SEL sel = sel_registerName(selNameAsChars);
      (*env)->ReleaseStringUTFChars(env, selName, selNameAsChars);
-    return ptr_to_jlong(sel);
+    return ptr_to_jlong((void*)sel);
  }

  JNIEXPORT jstring JNICALL Java_com_apple_jobjc_SEL_getSelectorName


More information about the macosx-port-dev mailing list