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

Anthony Petrov anthony.petrov at oracle.com
Mon Feb 11 06:01:49 PST 2013


The code can run into a problem if Apple change the underlying type of 
SEL to something completely different (and larger) than a void* pointer. 
However, I think this is unlikely to happen.

The evaluation sounds reasonable to me, so consider the fix reviewed.

--
best regards,
Anthony

On 02/09/13 02:10, Phil Race wrote:
> 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