[OpenJDK 2D-Dev] <AWT Dev> [12]RFR: [JDK-8074824]: Resolve disabled warnings for libawt_xawt

Krishna Addepalli krishna.addepalli at oracle.com
Tue Nov 27 11:14:09 UTC 2018


Hi Phil,

 

To reduce the scope, I have created a new webrev, which addresses only warnings on Linux platform.

Warnings for other platforms will be addressed in separate bugs.

Here is the new webrev: http://cr.openjdk.java.net/~kaddepalli/8074824/webrev02/

 

For your reference, I'm attaching the warning log generated by the compiler for each warning type. Hope this helps in the review.

I ran the all the jtreg tests, but I'm not sure if the changes have caused any problems. 

I checked with Ajit (who tried to address this issue before), and ran SwingSet2 with GTK2 and GTK3 and did not find any crashes.

 

Thanks,

Krishna

 

From: Krishna Addepalli 
Sent: Tuesday, October 2, 2018 8:53 PM
To: Philip Race <philip.race at oracle.com>
Cc: awt-dev at openjdk.java.net; 2d-dev <2d-dev at openjdk.java.net>; build-dev <build-dev at openjdk.java.net>
Subject: Re: [OpenJDK 2D-Dev] <AWT Dev> [12]RFR: [JDK-8074824]: Resolve disabled warnings for libawt_xawt

 

Yes, that is right.

I have compiled it Mac, Linux and Windows locally. I tried submitting a Mach5 job, but was unable to as it was down. Will try it again.

 

Thanks

Krishna





On 02-Oct-2018, at 3:39 AM, Philip Race <HYPERLINK "mailto:philip.race at oracle.com"philip.race at oracle.com> wrote:

 

I suspect I understand this one now .. the array is stack allocated so we don't want NULL
but the compiler probably complained about possible uninitialised use of the values ?

-phil.

On 10/1/18, 9:38 AM, Philip Race wrote:

You really do need to explain *each* of the changes better.
This one .. why not NULL ?
HYPERLINK "http://cr.openjdk.java.net/%7Ekaddepalli/8074824/webrev01/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c.udiff.html"http://cr.openjdk.java.net/~kaddepalli/8074824/webrev01/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c.udiff.html

-phil

On 10/1/18, 9:19 AM, Philip Race wrote:

Hi,

1) Has this been built on all platforms ?
2)  I can't find the list of warnings that you are seeing and fixing and they are all over the place.
So adding 2d-dev and build-dev.
For each of these changes, please show what was the warning that you received from the compiler
This might sound like a lot of work, but it won't be disproportionate and I've made the same
request for similar reviews and without it, it is hard to review the changes.

For example (and I do mean just example) 
HYPERLINK "http://cr.openjdk.java.net/%7Ekaddepalli/8074824/webrev01/src/java.desktop/unix/native/common/awt/awt_Font.c.udiff.html"http://cr.openjdk.java.net/~kaddepalli/8074824/webrev01/src/java.desktop/unix/native/common/awt/awt_Font.c.udiff.html

why would that not be #ifdef instead ?

3) Testing .. did you run at least all our jtreg tests to make sure you didn't break
some behaviour ..

-phil.

On 9/29/18, 8:18 PM, Krishna Addepalli wrote:

Hi All, 

 

Please review a fix for JDK-8074824: https://bugs.openjdk.java.net/browse/JDK-8074824

Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Ekaddepalli/8074824/webrev01/"http://cr.openjdk.java.net/~kaddepalli/8074824/webrev01/

 

Most of the warnings have been fixed for Linux, Mac and Windows.

 

Thanks,

Krishna

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20181127/3f61c60a/attachment-0001.html>
-------------- next part --------------
Warning: type-limits
Files Affected:
1. In file included from /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c:31:0:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c: In function ???Java_sun_awt_X11_XlibWrapper_SetBitmapShape???:
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:47:32: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
 #define IS_SAFE_SIZE_T(x) ((x) >= 0 && (unsigned long long)(x) <= SIZE_MAX)
 /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c:2301:23: note: in expansion of macro ???SAFE_SIZE_ARRAY_ALLOC???

2. In file included from /home/krishna/jdklatest/open/src/java.desktop/unix/native/common/awt/fontpath.c:44:0:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/common/awt/fontpath.c: In function ???AddFontsToX11FontPath???:
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:47:32: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
 #define IS_SAFE_SIZE_T(x) ((x) >= 0 && (unsigned long long)(x) <= SIZE_MAX)
 /home/krishna/jdklatest/open/src/java.desktop/unix/native/common/awt/fontpath.c:289:19: note: in expansion of macro ???SAFE_SIZE_ARRAY_ALLOC???

 3. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c: In function ???recode_color???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c:2021:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
     if (result > 65535) {

4. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c:593:34: note: in expansion of macro ???SAFE_SIZE_STRUCT_ALLOC???
             gchar *s, *new_env = SAFE_SIZE_STRUCT_ALLOC(malloc,
                                  ^~~~~~~~~~~~~~~~~~~~~~

Warning: pointer-to-int-cast
Files Affected:
1./home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c:2186:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
     return (jint) XSynchronize((Display*)jlong_to_ptr(display), (onoff == JNI_TRUE ? True : False));
            ^

Warning: unused-result
Files Affected:
1. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c: In function ???wakeUp???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:750:9: error: ignoring return value of ???write???, declared with attribute warn_unused_result [-Werror=unused-result]
         write ( AWT_WRITEPIPE, &wakeUp_char, 1 );
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Warning: maybe-uninitialized
Files Affected: None

Warning: int-to-pointer-cast
Files Affected: None

Warning: format-security
Files Affected: None

Warning: parantheses
Files Affected:
1. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c: In function ???Java_sun_awt_X11_XTaskbarPeer_setBadge???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c:155:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if (m = fp_unity_launcher_entry_get_quicklist(entry)) {
         ^
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c: In function ???Java_sun_awt_X11_XTaskbarPeer_setUrgent???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c:171:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if (m = fp_unity_launcher_entry_get_quicklist(entry)) {
         ^
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c: In function ???Java_sun_awt_X11_XTaskbarPeer_updateProgress???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c:188:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if (m = fp_unity_launcher_entry_get_quicklist(entry)) {

2. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c:925:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk3_widgets[_GTK_BUTTON_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c:932:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk3_widgets[_GTK_CHECK_BUTTON_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c:940:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk3_widgets[_GTK_CHECK_MENU_ITEM_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c:961:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk3_widgets[_GTK_COMBO_BOX_TYPE]))

3. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c:83:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if (pendingException = (*env)->ExceptionOccurred(env)) {
         ^~~~~~~~~~~~~~~~

Warning: undef
1. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/multi_font.c:241:5: error: "FONT_DEBUG" is not defined, evaluates to 0 [-Werror=undef]
 #if FONT_DEBUG >= 2
     ^~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/multi_font.c:245:5: error: "FONT_DEBUG" is not defined, evaluates to 0 [-Werror=undef]
 #if FONT_DEBUG
     ^~~~~~~~~~

Warning:       # redefining a macro:
      BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w
n file included from /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:34:0:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c: In function ???gtk2_load???:
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:47:32: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
 #define IS_SAFE_SIZE_T(x) ((x) >= 0 && (unsigned long long)(x) <= SIZE_MAX)
                                ^
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:50:27: note: in expansion of macro ???IS_SAFE_SIZE_T???
     (IS_SAFE_SIZE_T(m) && IS_SAFE_SIZE_T(n) && ((m) == 0 || (n) == 0 || (size_t)(n) <= (SIZE_MAX / (size_t)(m))))
                           ^~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:102:7: note: in expansion of macro ???IS_SAFE_SIZE_MUL???
       IS_SAFE_SIZE_MUL((m), (n)) && IS_SAFE_SIZE_ADD((m) * (n), (a)) \
       ^~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:114:6: note: in expansion of macro ???IS_SAFE_STRUCT_SIZE???
     (IS_SAFE_STRUCT_SIZE((a), (m), (n)) ? ((func)((a) + (m) * (n))) : FAILURE_RESULT)
      ^~~~~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:773:34: note: in expansion of macro ???SAFE_SIZE_STRUCT_ALLOC???
             gchar *s, *new_env = SAFE_SIZE_STRUCT_ALLOC(malloc,
                                  ^~~~~~~~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:47:32: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
 #define IS_SAFE_SIZE_T(x) ((x) >= 0 && (unsigned long long)(x) <= SIZE_MAX)
                                ^
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:53:6: note: in expansion of macro ???IS_SAFE_SIZE_T???
     (IS_SAFE_SIZE_T(a) && IS_SAFE_SIZE_T(b) && (size_t)(b) <= (SIZE_MAX - (size_t)(a)))
      ^~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:102:37: note: in expansion of macro ???IS_SAFE_SIZE_ADD???
       IS_SAFE_SIZE_MUL((m), (n)) && IS_SAFE_SIZE_ADD((m) * (n), (a)) \
                                     ^~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.base/share/native/libjava/sizecalc.h:114:6: note: in expansion of macro ???IS_SAFE_STRUCT_SIZE???
     (IS_SAFE_STRUCT_SIZE((a), (m), (n)) ? ((func)((a) + (m) * (n))) : FAILURE_RESULT)
      ^~~~~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:773:34: note: in expansion of macro ???SAFE_SIZE_STRUCT_ALLOC???
             gchar *s, *new_env = SAFE_SIZE_STRUCT_ALLOC(malloc,
                                  ^~~~~~~~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c: In function ???init_toggle_widget???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1094:41: error: suggest parentheses around ???&&??? within ???||??? [-Werror=parentheses]
     if ((synth_state & MOUSE_OVER) != 0 && (synth_state & PRESSED) == 0 ||
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c: In function ???gtk2_get_widget???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1164:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_BUTTON_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1171:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_CHECK_BUTTON_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1179:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_CHECK_MENU_ITEM_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1200:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_COMBO_BOX_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1208:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result =
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1217:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result =
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1228:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_LABEL_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1238:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_CONTAINER_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1252:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_TEXT_VIEW_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1262:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_ENTRY_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1270:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_HANDLE_BOX_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1282:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_HSCROLLBAR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1290:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_HSEPARATOR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1300:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_HSCALE_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1309:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_HPANED_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1316:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_IMAGE_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1323:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_WINDOW_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1331:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_TOOLTIP_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1343:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_TREE_VIEW_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1351:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_FRAME_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1358:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_MENU_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1368:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_MENU_ITEM_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1376:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_MENU_BAR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1385:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_DIALOG_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1393:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result =
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1402:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_HPROGRESS_BAR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1410:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_VPROGRESS_BAR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1425:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_RADIO_BUTTON_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1433:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result =
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1442:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result =
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1453:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_SPIN_BUTTON_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1464:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_NOTEBOOK_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1472:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_TOGGLE_BUTTON_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1481:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_TOOLBAR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1489:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result =
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1498:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_VIEWPORT_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1511:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_VSCROLLBAR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1519:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_VSEPARATOR_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1529:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_VSCALE_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1543:17: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             if (init_result = (NULL == gtk2_widgets[_GTK_VPANED_TYPE]))
                 ^~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c: In function ???get_integer_property???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:2454:19: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     gint intval = NULL;
                   ^~~~
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c: In function ???get_boolean_property???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:2461:19: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     gint intval = NULL;
                   ^~~~

Warning:  # comparison between pointer and integer
      BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w
None

Warning:       # initializing a declared 'extern'
      BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w
1. /home/krishna/jdklatest/open/src/java.desktop/share/native/common/awt/debug/debug_mem.c:77:33: error: ???DMemStatePtr??? initialized and declared ???extern??? [-Werror]
 extern const DMemState *        DMemStatePtr = &DMemGlobalState;
                                 ^~~~~~~~~~~~


Warning: implicit-fallthrough
1.



# Turn off all warnings for debug_mem.c This is needed because the specific warning
# about initializing a declared 'extern' cannot be turned off individually. Only
# applies to debug builds.
  BUILD_LIBAWT_debug_mem.c_CFLAGS := -w





Warning: parantheses
1. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt/awt/awt_Mlib.c: In function ???awt_getImagingLib???:
/home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt/awt/awt_Mlib.c:66:59: error: suggest parentheses around ???&&??? within ???||??? [-Werror=parentheses]
     if ((uname(&name) >= 0) && (getenv("NO_VIS") == NULL) &&
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
         (strncmp(name.machine, "sun4u" , 5) == 0) ||
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Warning: format-overflow
1. /home/krishna/jdklatest/open/src/java.desktop/share/native/common/awt/debug/debug_mem.c:281:9: error: ???
-------??? directive writing 8 bytes into a region of size between 0 and 4103 [-Werror=format-overflow=]
         "file:  %s, line %d\n"
         ^~~~~~~~~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/common/awt/debug/debug_mem.c:283:19: note: format string is defined here
         "order: %d\n"
                   ^~~
         "-------";
         ~~~~~~~~

Warning: sign-compare
1. /home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/java2d/loops/TransformHelper.c:410:27: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         pEdges = (memsize == ((size_t) memsize))
                           ^~
2. /home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c: In function ???Java_sun_awt_image_ImagingLib_convolveBI???:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:42:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      (((0x7fffffff / (w)) / (h)) > (sz)))
                                  ^
3.                           ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c:322:13: note: in expansion of macro ???SAFE_TO_ALLOC_2???
         if (SAFE_TO_ALLOC_2(rasterP->numDataElements, sizeof(jint))) {
             ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:38:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      ((0x7fffffff / (c)) > (sz)))
                          ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c:357:13: note: in expansion of macro ???SAFE_TO_ALLOC_2???
         if (SAFE_TO_ALLOC_2(rasterP->numDataElements, sizeof(jint))) {
             ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c: In function ???awt_parseColorModel???:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:38:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      ((0x7fffffff / (c)) > (sz)))
                          ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c:489:9: note: in expansion of macro ???SAFE_TO_ALLOC_2???
     if (SAFE_TO_ALLOC_2(cmP->numComponents, sizeof(jint))) {
         ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c: In function ???setHints???:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:38:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      ((0x7fffffff / (c)) > (sz)))
                          ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c:704:9: note: in expansion of macro ???SAFE_TO_ALLOC_2???
     if (SAFE_TO_ALLOC_2(hintP->numChans, sizeof(int))) {
         ^~~~~~~~~~~~~~~
In file included from /home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:44:0:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c: In function ???Java_sun_awt_image_ImagingLib_convolveBI???:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:42:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      (((0x7fffffff / (w)) / (h)) > (sz)))
                                  ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:336:9: note: in expansion of macro ???SAFE_TO_ALLOC_3???
     if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_d64))) {
         ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:42:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      (((0x7fffffff / (w)) / (h)) > (sz)))
                                  ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:419:9: note: in expansion of macro ???SAFE_TO_ALLOC_3???
     if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_s32))) {
         ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c: In function ???Java_sun_awt_image_ImagingLib_convolveRaster???:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:42:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      (((0x7fffffff / (w)) / (h)) > (sz)))
                                  ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:577:9: note: in expansion of macro ???SAFE_TO_ALLOC_3???
     if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_d64))) {
         ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:42:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      (((0x7fffffff / (w)) / (h)) > (sz)))
                                  ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:665:9: note: in expansion of macro ???SAFE_TO_ALLOC_3???
     if (SAFE_TO_ALLOC_3(w, h, sizeof(mlib_s32))) {
         ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c: In function ???Java_sun_awt_image_ImagingLib_lookupByteBI???:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:38:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      ((0x7fffffff / (c)) > (sz)))
                          ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:1378:9: note: in expansion of macro ???SAFE_TO_ALLOC_2???
     if (SAFE_TO_ALLOC_2(ncomponents, sizeof(unsigned char *))) {
         ^~~~~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libmlib_image/safe_alloc.h:38:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
      ((0x7fffffff / (c)) > (sz)))
                          ^
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:1384:9: note: in expansion of macro ???SAFE_TO_ALLOC_2???
     if (SAFE_TO_ALLOC_2(lut_nbands, sizeof(LookupArrayInfo))) {
         ^~~~~~~~~~~~~~~



Warning: unused-result
1. /home/krishna/jdklatest/open/src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c:124:5: error: ignoring return value of ???realpath???, declared with attribute warn_unused_result [-Werror=unused-result]
     realpath((char *)dlinfo.dli_fname, buf);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Warning: maybe-uninitialized
1. /home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c: In function ???ProcessPath???:
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c:872:41: error: ???params[0]??? may be used uninitialized in this function [-Werror=maybe-uninitialized]
                     (jfloat)(param/(1.0 - params[0])));
                                    ~~~~~^~~~~~~~~~~~
/home/krishna/jdklatest/open/src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c:787:12: note: ???params[0]??? was declared here
     double params[2];
            ^~~~~~

Warning: format-nonliteral
None


More information about the 2d-dev mailing list