< prev index next >

make/lib/Awt2dLibraries.gmk

Print this page

        

@@ -344,34 +344,50 @@
     endif
 
     ifeq ($(TOOLCHAIN_TYPE), gcc)
       # Turn off all warnings for the following files since they contain warnings
       # that cannot be turned of individually.
-      # redefining a macro
-      BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w
-      # comparison between pointer and integer
-      BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w
       # initializing a declared 'extern'
       BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
       # decimal constant is unsigned only in ISO C90 (JAVASE_EMBEDDED)
       BUILD_LIBAWT_XAWT_XToolkit.c_CFLAGS := -w
+
+      # Following files use macro from jdk/src/java.base/share/native/libjava/sizecalc.h
+      # These macros when used with 'unsigned int' result in 'type-limits' warning. 
+      # These macros can be used with 'int' as well. 
+      # Hence, warnings are suppressed from below files instead of changing the macros.
+      BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -Wno-type-limits
+      BUILD_LIBAWT_XAWT_gtk3_interface.c_CFLAGS := -Wno-type-limits
+      BUILD_LIBAWT_XAWT_XlibWrapper.c_CFLAGS := -Wno-type-limits
+      BUILD_LIBAWT_XAWT_fontpath.c_CFLAGS := -Wno-type-limits
+
+      # Strings are constructed and populated using sprintf.
+      BUILD_LIBAWT_XAWT_OGLPaints.c_CFLAGS := -Wno-format-nonliteral
+      BUILD_LIBAWT_XAWT_OGLBufImgOps.c_CFLAGS := -Wno-format-nonliteral
    endif
 
+    ifeq ($(OPENJDK_TARGET_OS), solaris)
+      # function pointers are assigned void pointers
+      BUILD_LIBAWT_XAWT_awt_Taskbar.c_CFLAGS := -erroff=E_ASSIGNMENT_TYPE_MISMATCH
+      BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -erroff=E_ASSIGNMENT_TYPE_MISMATCH,E_NON_CONST_INIT
+      BUILD_LIBAWT_XAWT_gtk3_interface.c_CFLAGS := -erroff=E_ASSIGNMENT_TYPE_MISMATCH
+    endif
+
+    # E_DECLARATION_IN_CODE warning from Solaris C compiler is suppressed as-
+    # There are places where the variables are declared after the validation checks(early returns)
+
     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
         LIBRARY := awt_xawt, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
         SRC := $(LIBAWT_XAWT_DIRS), \
         EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
         OPTIMIZATION := LOW, \
         CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
             $(X_CFLAGS), \
         WARNINGS_AS_ERRORS_xlc := false, \
-        DISABLED_WARNINGS_gcc := type-limits pointer-to-int-cast \
-            deprecated-declarations unused-result maybe-uninitialized format \
-            format-security int-to-pointer-cast parentheses, \
+        DISABLED_WARNINGS_gcc := deprecated-declarations,\
         DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
-            E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
         MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN) \
             $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
             -L$(INSTALL_LIBRARIES_HERE), \
< prev index next >