Skip to content

says "you must also specify \Og" but that is not true#2300

Merged
colin-home merged 2 commits into
MicrosoftDocs:masterfrom
angusgraham:patch-1
Jul 8, 2020
Merged

says "you must also specify \Og" but that is not true#2300
colin-home merged 2 commits into
MicrosoftDocs:masterfrom
angusgraham:patch-1

Conversation

@angusgraham

Copy link
Copy Markdown
Contributor

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]

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]
@PRMerger18

Copy link
Copy Markdown
Contributor

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

@angusgraham

Copy link
Copy Markdown
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.
@PRMerger13

Copy link
Copy Markdown
Contributor

@corob-msft : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@colin-home colin-home left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@colin-home colin-home merged commit f5830fa into MicrosoftDocs:master Jul 8, 2020
@angusgraham angusgraham deleted the patch-1 branch October 8, 2022 21:59
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.

5 participants