says "you must also specify \Og" but that is not true#2300
Merged
Conversation
Doc for /Ot /Os says `If you use **/Os** or **/Ot**, then you must also specify [/Og](og-global-optimizations.md) to optimize the code.` ...but if you look at the doc for /Og it says "Deprecated. Provides local and global optimizations, automatic-register allocation, and loop optimization. We recommend you use either /O1 (Minimize Size) or /O2 (Maximize Speed) instead." ...and in the remarks section "/Og is deprecated. These optimizations are now generally enabled by default. For more information on optimizations, see /O1, /O2 (Minimize Size, Maximize Speed) or /Ox (Enable Most Speed Optimizations)." ...so I've removed the misleading instruction to turn on /Og (which is actually not even possible through the Visual Studio options optimization pane - which makes sense since it's deprecated) and instead added a more generic message about turning on optimizations (copied the "For more information" part from https://github.com/MicrosoftDocs/cpp-docs/edit/master/docs/build/reference/og-global-optimizations.md) Since it's no longer a direct instruction but just further info I've changed it to a [!NOTE]
Contributor
|
@angusgraham : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
Contributor
Author
|
Looking at a grep of cpp-docs for /Og (https://github.com/MicrosoftDocs/cpp-docs/search?q=Og&unscoped_q=Og) it looks like most references to /Og are similarly misleading. I'm not going to fix them all but I suggest someone should. |
It's true that /Og is not required with /Os or /Ot anymore, and hasn't been for a long time. I think just removing that statement is enough for now.
Contributor
|
@corob-msft : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
colin-home
approved these changes
Jul 8, 2020
colin-home
left a comment
Contributor
There was a problem hiding this comment.
@angusgraham Thanks for taking the time to contribute a fix to the docs. I'll look into the other references to /Og for a more comprehensive fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Doc for /Ot /Os says
If you use **/Os** or **/Ot**, then you must also specify [/Og](og-global-optimizations.md) to optimize the code....but if you look at the doc for /Og it says
"Deprecated. Provides local and global optimizations, automatic-register allocation, and loop optimization. We recommend you use either /O1 (Minimize Size) or /O2 (Maximize Speed) instead."
...and in the remarks section
"/Og is deprecated. These optimizations are now generally enabled by default. For more information on optimizations, see /O1, /O2 (Minimize Size, Maximize Speed) or /Ox (Enable Most Speed Optimizations)."
...so I've removed the misleading instruction to turn on /Og (which is actually not even possible through the Visual Studio options optimization pane - which makes sense since it's deprecated) and instead added a more generic message about turning on optimizations (copied the "For more information" part from https://github.com/MicrosoftDocs/cpp-docs/edit/master/docs/build/reference/og-global-optimizations.md)
Since it's no longer a direct instruction but just further info I've changed it to a [!NOTE]