Skip to content
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

8345589: Simplify Windows definition of strtok_r #22597

Closed
wants to merge 1 commit into from

Conversation

kimbarrett
Copy link

@kimbarrett kimbarrett commented Dec 6, 2024

Please review this change to move the Windows-specific definition of strtok_r
to globalDefinitions_visCPP.hpp. In addition, the unused S_ISCHR macro is
removed and the S_ISFIFO macro is also moved.

Testing: mach5 tier1


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-8345589: Simplify Windows definition of strtok_r (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22597

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 6, 2024

👋 Welcome back kbarrett! 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.

@openjdk
Copy link

openjdk bot commented Dec 6, 2024

@kimbarrett 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:

8345589: Simplify Windows definition of strtok_r

Reviewed-by: dholmes, jwaters

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 9 new commits pushed to the master branch:

  • 2286fae: 8345159: RISCV: Fix -Wzero-as-null-pointer-constant warning in emit_static_call_stub
  • 8403285: 8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield
  • aa38284: 8345435: Eliminate tier1_compiler_not_xcomp group
  • 9284602: 8345628: [BACKOUT] JDK-8287122 Use gcc12 -ftrivial-auto-var-init=pattern in debug builds
  • 41c8971: 8287122: Use gcc12 -ftrivial-auto-var-init=pattern in debug builds
  • 5da0eee: 8285692: Enable _FORTIFY_SOURCE=2 when building with Clang
  • daa2ba5: 8339622: Regression in make open-hotspot-xcode-project
  • 6f6bce5: 8344559: Log is spammed by missing pandoc warnings when building man pages
  • 5f30a8d: 8345424: Move FindDebuginfoFiles out of FileUtils.gmk

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 6, 2024
@openjdk
Copy link

openjdk bot commented Dec 6, 2024

@kimbarrett The following label will be automatically applied to this pull request:

  • hotspot

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

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Dec 6, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 6, 2024

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Looks good.

Thanks

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 6, 2024
// *not* the same as the C99 Annex K strtok_s. VS provides that function
// under the name strtok_s_l. Make strtok_r a synonym so we can use that name
// in shared code.
const auto strtok_r = strtok_s;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just 1 question, is strtok_r in this VC definition a function pointer? I don't think I've ever seen code do this before. Also, I think Annex K is C11, not C99

Copy link
Contributor

@TheShermanTanker TheShermanTanker left a comment

Choose a reason for hiding this comment

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

This moves it to a place inaccessible to my port, but it's a small change and I can handle it rather easily, so I'm ok with this.

@mlbridge
Copy link

mlbridge bot commented Dec 6, 2024

Mailing list message from Kim Barrett on hotspot-dev:

On 12/6/24 3:10 AM, Julian Waters wrote:

On Fri, 6 Dec 2024 06:25:12 GMT, Kim Barrett<kbarrett at openjdk.org> wrote:

Please review this change to move the Windows-specific definition of strtok_r
to globalDefinitions_visCPP.hpp. In addition, the unused S_ISCHR macro is
removed and the S_ISFIFO macro is also moved.

Testing: mach5 tier1
This moves it to a place inaccessible to my port, but it's a small change and I can handle it rather easily, so I'm ok with this.

I suspected that might happen.? But this new location seems like a
better place for it than where it was.

I'm assuming you're going to have some non-trivial rearrangement of
things in the globalDefinitions vicinity.

src/hotspot/share/utilities/globalDefinitions_visCPP.hpp line 89:

87: // under the name strtok_s_l. Make strtok_r a synonym so we can use that name
88: // in shared code.
89: const auto strtok_r = strtok_s;
Just 1 question, is strtok_r in this VC definition a function pointer?

Yes.

I don't think I've ever seen code do this before. Also, I think Annex K is C11, not C99

Oops. I thought I had C99 open when I was looking at Annex K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20241206/64dfe516/attachment-0001.htm>

@kimbarrett
Copy link
Author

Thanks for reviews @dholmes-ora and @TheShermanTanker

@kimbarrett
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 9, 2024

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

  • 153dc6d: 8345133: Test sun/security/tools/jarsigner/TsacertOptionTest.java failed: Warning found in stdout
  • d7ef3ac: 8345684: OperatingSystemMXBean.getSystemCpuLoad() throws NPE
  • 830173f: 8344068: Windows x86-64: Out of CodeBuffer space when generating final stubs
  • 69e664d: 8345632: [ASAN] memory leak in get_numbered_property_as_sorted_string function
  • 842b363: 8345698: Remove tier1_compiler_not_xcomp from github actions
  • 458979d: 8344611: Add missing classpath exception
  • 83ea013: 8345629: Remove expired flags in JDK 25
  • c517ffb: 8339910: RISC-V: crc32 intrinsic with carry-less multiplication
  • e0d6398: 8344575: Examine usage of ReflectUtil.forName() in java.sql.rowset - XmlReaderContentHandler
  • 470701f: 8340969: jdk/jfr/startupargs/TestStartDuration.java should be marked as flagless
  • ... and 15 more: https://git.openjdk.org/jdk/compare/bf0debc023a42ccdf2f589039e4d98e11424b4dd...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 9, 2024
@openjdk openjdk bot closed this Dec 9, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 9, 2024
@openjdk
Copy link

openjdk bot commented Dec 9, 2024

@kimbarrett Pushed as commit e821d59.

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

@kimbarrett kimbarrett deleted the windows_strtok_r branch December 9, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants