8365296: Build failure with Clang due to -Wformat warning after JDK-8364611#26771
8365296: Build failure with Clang due to -Wformat warning after JDK-8364611#26771hgqxjj wants to merge 5 commits intoopenjdk:masterfrom
Conversation
…364611
This issue is related to the definition of __sigset_t (__sigset_t act.sa_mask).
In the glibc source, __sigset_t is defined in multiple places:
- bits/types/__sigset_t.h
- sysdeps/unix/sysv/linux/bits/types/__sigset_t.h (introduced after glibc 2.25)
During compilation with Clang, the latter definition appears to be used, where __sigset_t is a struct, causing the printf("%X", act.sa_mask) to fail.
|
👋 Welcome back ghan! A progress list of the required criteria for merging this PR into |
|
@hgqxjj 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: 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 16 new commits pushed to the
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 (@albertnetymk, @MBaesken) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
a small fix
|
Seems there is also coding in os_posix.cpp ( describe_signal_set_short ) to print signal information , maybe 'borrow' from there? |
Refactor act.sa_mask output
a small fix
|
Hi @MBaesken |
albertnetymk
left a comment
There was a problem hiding this comment.
The fix looks reasonable. However, the discrepancy btw and AIX and others seems unnecessary complexity. I'd prefer having ifdef removed also.
Looking at how these prints are used/tested, I believe sa_mask is not really needed and it doesn't seem very useful also. Therefore, I'd suggest removing it, just like what's done for AIX. My 2c.
|
hi @albertnetymk , thanks for the feedback! I agree that removing it would be the simplest solution. |
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. | |||
| * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. | |||
There was a problem hiding this comment.
nit: XX, YY, means that this file was created in XX year and the latest update is done in YY year. If XX == YY, then use XX,.
| * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. | |
| * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Hi @shqking , thanks for the suggestion! I checked the file history, and it was actually created in 2025. Therefore, I updated the copyright to Copyright (c) 2025 to reflect the correct creation year. If the file gets updated in the future, we can follow the “XX, YY” format.
That's fine . |
Remove unnecessary sa_mask printing based on reviewer feedback
|
@MBaesken @albertnetymk |
|
/integrate |
|
Many thanks to both of you @MBaesken @albertnetymk for your review and approval. I’ve integrated the changes. |
|
/sponsor |
|
Going to push as commit b6d5f49.
Your commit was automatically rebased without conflicts. |
This issue is related to the definition of __sigset_t (__sigset_t act.sa_mask). In the glibc source, __sigset_t is defined in multiple places:
During compilation with Clang, the latter definition appears to be used, where __sigset_t is a struct, causing the printf("%X", act.sa_mask) to fail.
we can detect whether _SIGSET_NWORDS is defined and handle the printing differently based on that, ensuring correct handling of the struct type.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26771/head:pull/26771$ git checkout pull/26771Update a local copy of the PR:
$ git checkout pull/26771$ git pull https://git.openjdk.org/jdk.git pull/26771/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26771View PR using the GUI difftool:
$ git pr show -t 26771Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26771.diff
Using Webrev
Link to Webrev Comment