Skip to content

Conversation

@jdpatdiscord
Copy link
Contributor

Without this clarification, it implies that you will always get the example output. I see no reason to change the actual example code other than to just make clear what the behavior of it will be under different bitness.

@prmerger-automator
Copy link
Contributor

@jdpatdiscord : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 5175ad6:

✅ Validation status: passed

File Status Preview URL Details
docs/cpp/ptr32-ptr64.md ✅Succeeded

For more details, please refer to the build report.

@v-dirichards v-dirichards requested a review from Copilot December 8, 2025 21:39
@v-dirichards
Copy link
Contributor

@TylerMSFT

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged Tracking label for the PR review team label Dec 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR clarifies the behavior of the __ptr32 and __ptr64 example code by explaining that the example crashes when compiled for 64-bit but may not crash when compiled for 32-bit, addressing potential confusion about the expected output shown in the documentation.

Key changes:

  • Added clarification that the example code crashes on 64-bit compilation due to pointer truncation
  • Explained why the code does not necessarily crash on 32-bit compilation

## Example

The following example shows how to declare and allocate pointers with the **`__ptr32`** and **`__ptr64`** keywords.
The following example shows how to declare and allocate pointers with the **`__ptr32`** and **`__ptr64`** keywords. This code will crash when compiled for 64-bit due to the pointer from `malloc` being truncated to 32-bit. Since 32-bit pointers can be represented in 64-bit, when compiled for 32-bit this code does not necessarily crash.
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

The phrase "This code will crash" uses future tense ("will"). According to the Microsoft Writing Style Guide, use present tense verbs instead of future tense. Consider: "This code crashes when compiled for 64-bit..."

Copilot generated this review using guidance from repository custom instructions.
@jdpatdiscord
Copy link
Contributor Author

Any thoughts on what to keep from the Copilot suggestions?

Updated to address Copilot suggestions.
@TylerMSFT
Copy link
Collaborator

TylerMSFT commented Dec 17, 2025

@jdpatdiscord , I took a shot at it and updated the PR. See what you think.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 5b6b51b:

✅ Validation status: passed

File Status Preview URL Details
docs/cpp/ptr32-ptr64.md ✅Succeeded

For more details, please refer to the build report.

@v-dirichards
Copy link
Contributor

Closing/reopening to refresh the CLA status

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 5b6b51b:

✅ Validation status: passed

File Status Preview URL Details
docs/cpp/ptr32-ptr64.md ✅Succeeded

For more details, please refer to the build report.

@v-dirichards
Copy link
Contributor

v-dirichards commented Dec 17, 2025

@jdpatdiscord Thank you for your contribution. Would you take a moment to sign the Contributor License Agreement (CLA)? We won't be able to merge this PR without it.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@jdpatdiscord
Copy link
Contributor Author

@jdpatdiscord , I took a shot at it and updated the PR. See what you think.

I have no problems with the changes given that it's possible to allocate at low address ranges on a 64-bit process between various linker flags and VirtualAlloc behavior. My changes I wanted to keep short to just avoid problems and convey the idea as short as possible.

@jdpatdiscord
Copy link
Contributor Author

@microsoft-github-policy-service agree

Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

Thank you @jdpatdiscord for your clarification in this article.

@TylerMSFT
Copy link
Collaborator

#sign-off

@v-dirichards v-dirichards merged commit a897ad6 into MicrosoftDocs:main Dec 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants