Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cpp/ptr32-ptr64.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For compatibility with previous versions, **_ptr32** and **_ptr64** are synonyms

## 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.
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.

According to the Microsoft Writing Style Guide, break up long sentences for better readability. This sentence contains multiple independent clauses. Consider splitting into separate sentences:

"This code crashes when compiled for 64-bit due to the pointer from malloc being truncated to 32-bit. When compiled for 32-bit, this code does not necessarily crash because 32-bit pointers can be represented in 64-bit."

Copilot generated this review using guidance from repository custom instructions.
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 phrasing "when compiled for 32-bit this code does not necessarily crash" is ambiguous. The statement "32-bit pointers can be represented in 64-bit" appears to be explaining the wrong scenario - it should explain why 64-bit pointers can fit in 32-bit address space on 32-bit systems (they can't exceed 32-bit addresses). Consider clarifying the technical explanation:

"When compiled for 32-bit, this code does not crash because the __ptr64 pointer is truncated to 32-bit, which is sufficient for the 32-bit address space."

Suggested change
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.
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 because the pointer from `malloc` is truncated to 32 bits. When compiled for 32-bit, this code does not crash because the `__ptr64` pointer is truncated to 32 bits, which is sufficient for the 32-bit address space.

Copilot uses AI. Check for mistakes.

```cpp
#include <cstdlib>
Expand Down