-
Notifications
You must be signed in to change notification settings - Fork 966
Tweak C4172 warning reference #5445
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
base: main
Are you sure you want to change the base?
Tweak C4172 warning reference #5445
Conversation
@Rageking8 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Learn Build status updates of commit 10d9a37: ✅ Validation status: passed
For more details, please refer to the build report. |
PRMerger Results
|
@TylerMSFT - Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
We demo an unusual case but not perhaps a more common case. Added it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like what you did with this.
I thought the existing example was a little opaque, so explained it. And added the more common case example.
Learn Build status updates of commit 2acb092: ✅ Validation status: passed
For more details, please refer to the build report. |
PRMerger Results
|
#sign-off |
@@ -26,7 +26,7 @@ The following example generates C4172: | |||
const int* func1() | |||
{ | |||
int i = 42; | |||
return &i; // C4172 | |||
return &i; // C4172 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should standardize use of spaces over tabs and the 3 spaces before // CXXXX
.
Learn Build status updates of commit 4380ed1: ✅ Validation status: passed
For more details, please refer to the build report. |
PRMerger Results
|
f1_keywords: ["C4172"] | ||
helpviewer_keywords: ["C4172"] | ||
--- | ||
# Compiler Warning (level 1) C4172 | ||
|
||
> returning address of local variable or temporary | ||
> returning address of local variable or temporary : *optional_context* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that the warning message didn't account for the optional context.
Learn Build status updates of commit 78e1890: ✅ Validation status: passed
For more details, please refer to the build report. |
PRMerger Results
|
@TylerMSFT Would you add a comment to indicate what action to take on this PR? Thanks! |
/c
flag instead of/LD
f
with a float literal insteadbar
tofunc
const auto&