changeset 11612:1f7132eec73c

8074836: Resolve disabled warnings for libosxkrb5 8074835: Resolve disabled warnings for libj2gss Reviewed-by: erikj
author weijun
date Mon, 16 Mar 2015 18:08:01 +0800
parents 459dcd78652e
children e451c770c1d0
files make/lib/Lib-java.security.jgss.gmk src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c src/java.security.jgss/share/native/libj2gss/GSSLibStub.c
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/make/lib/Lib-java.security.jgss.gmk	Mon Mar 16 10:24:16 2015 +0100
+++ b/make/lib/Lib-java.security.jgss.gmk	Mon Mar 16 18:08:01 2015 +0800
@@ -41,7 +41,6 @@
       CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \
           $(LIBJAVA_HEADER_FLAGS) \
           -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
-      DISABLED_WARNINGS_gcc := pointer-to-int-cast, \
       MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
@@ -74,6 +73,8 @@
   endif
 
   ifneq ($(BUILD_LIBKRB5_NAME), )
+    # libosxkrb5 needs to call deprecated krb5 APIs so that java
+    # can use the native credentials cache.
     $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \
         LIBRARY := $(BUILD_LIBKRB5_NAME), \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@@ -83,7 +84,7 @@
         CFLAGS := $(CFLAGS_JDKLIB) \
             $(addprefix -I, $(BUILD_LIBKRB5_SRC)) \
             -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
-        DISABLED_WARNINGS_clang := implicit-function-declaration, \
+        DISABLED_WARNINGS_clang := deprecated-declarations, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN), \
         LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \
--- a/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c	Mon Mar 16 10:24:16 2015 +0100
+++ b/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c	Mon Mar 16 18:08:01 2015 +0800
@@ -25,6 +25,8 @@
 
 #import "sun_security_krb5_Credentials.h"
 #import <Kerberos/Kerberos.h>
+#import <string.h>
+#import <time.h>
 
 /*
  * Based largely on klist.c,
--- a/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c	Mon Mar 16 10:24:16 2015 +0100
+++ b/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c	Mon Mar 16 18:08:01 2015 +0800
@@ -430,11 +430,11 @@
 
     checkStatus(env, jobj, major, minor, "[GSSLibStub_canonicalizeName]");
     if ((*env)->ExceptionCheck(env)) {
-      return (jlong) GSS_C_NO_NAME;
+      return ptr_to_jlong(GSS_C_NO_NAME);
     }
     return ptr_to_jlong(mnNameHdl);
   }
-  return (jlong) GSS_C_NO_NAME;
+  return ptr_to_jlong(GSS_C_NO_NAME);
 }
 
 /*