Skip to content

JDK-8309224: Fix xlc17 clang 15 warnings in java.desktop #14263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

JoKern65
Copy link
Contributor

@JoKern65 JoKern65 commented Jun 1, 2023

This pr is a split off from JDK-8308288: Fix xlc17 clang warnings in shared code #14146
It handles the part in java.desktop.
prrace had already reviewed this part in the original pr.

Here are the handled errors for which we use the same warning disabling as gcc.

src/java.desktop/unix/native/common/awt/awt_GraphicsEnv.h:53:12: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration [-Werror,-Wdeprecated-non-prototype]
extern int XShmQueryExtension();
^
/usr/include/X11/extensions/XShm.h:91:6: note: conflicting prototype is here
Bool XShmQueryExtension(
^
solved by adding line (generic, because several source files are involved)
DISABLED_WARNINGS_clang_aix := deprecated-non-prototype, \

src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c:158:11: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
if (m = fp_unity_launcher_entry_get_quicklist(entry)) {
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
solved by adding line
DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \

src/java.desktop/share/native/common/java2d/opengl/OGLPaints.c:581:48: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
snprintf(cycleCode, sizeof(cycleCode), noCycleCode, texCoordCalcCode);
^~~~~~~~~~~
solved by adding line
DISABLED_WARNINGS_clang_aix_OGLPaints.c := format-nonliteral, \

src/java.desktop/share/native/common/java2d/opengl/OGLBufImgOps.c:153:48: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
snprintf(finalSource, sizeof(finalSource), convolveShaderSource,
^~~~~~~~~~~~~~~~~~~~
solved by adding line
DISABLED_WARNINGS_clang_aix_OGLBufImgOps.c := format-nonliteral, \

src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1095:41: error: '&&' within '||' [-Werror,-Wlogical-op-parentheses]
if ((synth_state & MOUSE_OVER) != 0 && (synth_state & PRESSED) == 0 ||

src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c:1180:29: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
if (init_result = (NULL == gtk2_widgets[_GTK_CHECK_MENU_ITEM_TYPE]))

solved by adding line
DISABLED_WARNINGS_clang_aix_gtk2_interface.c := parentheses logical-op-parentheses, \

src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c:903:29: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
if (init_result = (NULL == gtk3_widgets[_GTK_BUTTON_TYPE]))

solved by adding line
DISABLED_WARNINGS_clang_aix_gtk3_interface.c := parentheses, \

src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c:87:26: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
if (pendingException = (*env)->ExceptionOccurred(env)) {

solved by adding line
DISABLED_WARNINGS_clang_aix_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \

src/java.desktop/aix/native/libawt_xawt/awt/awt_InputMethod.c:1969:32: error: comparison of integers of different signs: 'Window' (aka 'unsigned long') and 'jlong' (aka 'long') [-Werror,-Wsign-compare]
if (currentFocusWindow != w) {

solved by adding line
DISABLED_WARNINGS_clang_aix_awt_InputMethod.c := sign-compare, \


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8309224: Fix xlc17 clang 15 warnings in java.desktop

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14263/head:pull/14263
$ git checkout pull/14263

Update a local copy of the PR:
$ git checkout pull/14263
$ git pull https://git.openjdk.org/jdk.git pull/14263/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14263

View PR using the GUI difftool:
$ git pr show -t 14263

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14263.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 1, 2023

👋 Welcome back JoKern65! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@JoKern65 JoKern65 marked this pull request as draft June 1, 2023 13:17
@openjdk
Copy link

openjdk bot commented Jun 1, 2023

@JoKern65 The following labels will be automatically applied to this pull request:

  • build
  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org client client-libs-dev@openjdk.org labels Jun 1, 2023
@JoKern65 JoKern65 changed the title JDK-8309224: Fix xlc17 clang 1.5 warnings in java.desktop JDK-8309224: Fix xlc17 clang 15 warnings in java.desktop Jun 1, 2023
@JoKern65 JoKern65 marked this pull request as ready for review June 1, 2023 16:59
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 1, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 1, 2023

Webrevs

@@ -693,6 +703,20 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
endif
endif

# The external libpng submitted in the jdk is an old version
# which does not contain .png_init_filter_functions_vsx.
# Therefore we need to disable PNG_POWERPC_VSX_OPT explicitely by setting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicitely -> explicitly

And it isn't an old version. It is very current.
I think we just chose not to import functionality we weren't using.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was fixed.

@openjdk
Copy link

openjdk bot commented Jun 1, 2023

@JoKern65 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8309224: Fix xlc17 clang 15 warnings in java.desktop

Reviewed-by: prr, goetz

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 37 new commits pushed to the master branch:

  • 8f1ce78: 8308752: Generational ZGC: Avoid final marking through stack chunks
  • 7b0a336: 8308387: CLD created and unloading list sharing _next node pointer leads to concurrent YC missing CLD roots
  • 60f3b87: 8309295: C2: MaxNode::signed_min() returns nullptr for int operands
  • 8007599: 8309093: Underscore with brackets
  • 5bd2af2: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents
  • 325940b: 8307105: JFileChooser InvalidPathException when selecting some system folders on Windows
  • 101bf22: 8308891: TestCDSVMCrash.java needs @requires vm.cds
  • 2bb1972: 8308954: [JVMCI] code installation increments decompile_count for call_site_target_value failures
  • 0ab0963: 8308469: [PPC64] Implement alternative fast-locking scheme
  • ec55539: 8309138: Fix container tests for jdks with symlinked conf dir
  • ... and 27 more: https://git.openjdk.org/jdk/compare/70670b4af617699782f892ae4cb5228ec655a2d0...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@prrace, @GoeLin) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 1, 2023
followed prrace annotation
@JoKern65
Copy link
Contributor Author

JoKern65 commented Jun 1, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 1, 2023
@openjdk
Copy link

openjdk bot commented Jun 1, 2023

@JoKern65
Your change (at version f9d99dc) is now ready to be sponsored by a Committer.

@JoKern65
Copy link
Contributor Author

JoKern65 commented Jun 2, 2023

Pre-submit failure is unrelated. Win testing passed in SAP nightlies.

Copy link
Member

@GoeLin GoeLin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GoeLin
Copy link
Member

GoeLin commented Jun 2, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 2, 2023

Going to push as commit dcd9590.
Since your change was applied there have been 37 commits pushed to the master branch:

  • 8f1ce78: 8308752: Generational ZGC: Avoid final marking through stack chunks
  • 7b0a336: 8308387: CLD created and unloading list sharing _next node pointer leads to concurrent YC missing CLD roots
  • 60f3b87: 8309295: C2: MaxNode::signed_min() returns nullptr for int operands
  • 8007599: 8309093: Underscore with brackets
  • 5bd2af2: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents
  • 325940b: 8307105: JFileChooser InvalidPathException when selecting some system folders on Windows
  • 101bf22: 8308891: TestCDSVMCrash.java needs @requires vm.cds
  • 2bb1972: 8308954: [JVMCI] code installation increments decompile_count for call_site_target_value failures
  • 0ab0963: 8308469: [PPC64] Implement alternative fast-locking scheme
  • ec55539: 8309138: Fix container tests for jdks with symlinked conf dir
  • ... and 27 more: https://git.openjdk.org/jdk/compare/70670b4af617699782f892ae4cb5228ec655a2d0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 2, 2023
@openjdk openjdk bot closed this Jun 2, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Jun 2, 2023
@openjdk
Copy link

openjdk bot commented Jun 2, 2023

@GoeLin @JoKern65 Pushed as commit dcd9590.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants