Skip to content

Fix erroneous __Pragma in link texts #5630

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions docs/c-language/c-pragmas.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
description: "Learn more about: C Pragmas"
title: "C Pragmas"
description: "Learn more about: C Pragmas"
ms.date: 07/26/2020
helpviewer_keywords: ["pragmas, C/C++"]
ms.assetid: 3d6d36b4-d565-4632-a4cd-e39aeaded5ad
---
# C Pragmas

Expand Down Expand Up @@ -59,7 +58,7 @@ A *pragma* instructs the compiler to perform a particular action at compile time
:::column-end:::
:::row-end:::

See [Pragma Directives and the `__Pragma` Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md) for a description of the Microsoft C compiler pragmas.
See [Pragma directives and the `__pragma` and `_Pragma` keywords](../preprocessor/pragma-directives-and-the-pragma-keyword.md) for a description of the Microsoft C compiler pragmas.

**END Microsoft Specific**

Expand Down
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3295.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
description: "Learn more about: Compiler Error C3295"
title: "Compiler Error C3295"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3295"
ms.date: 11/04/2016
f1_keywords: ["C3295"]
helpviewer_keywords: ["C3295"]
ms.assetid: 83f0aa4d-0e0a-4905-9f66-fcf9991fc07a
---
# Compiler Error C3295

'#pragma pragma' can only be used at global or namespace scope

Some pragmas cannot be used in a function. See [Pragma Directives and the __Pragma Keyword](../../preprocessor/pragma-directives-and-the-pragma-keyword.md) for more information.
Some pragmas cannot be used in a function. See [Pragma directives and the `__pragma` and `_Pragma` keywords](../../preprocessor/pragma-directives-and-the-pragma-keyword.md) for more information.

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Visual C++ might generate this warning for a code path that never executes. You
#pragma warning( pop )
```

This idiom keeps Visual C++ from generating the warning for that specific block of code. The `#pragma warning(push)` preserves the existing state before `#pragma warning(disable: 4789)` changes it. The `#pragma warning(pop)` restores the pushed state, and removes the effects of the `#pragma warning(disable:4789)`. For more information about the C++ preprocessor directive `#pragma`, see [`warning`](../../preprocessor/warning.md) and [Pragma Directives and the `__Pragma` Keyword](../../preprocessor/pragma-directives-and-the-pragma-keyword.md).
This idiom keeps Visual C++ from generating the warning for that specific block of code. The `#pragma warning(push)` preserves the existing state before `#pragma warning(disable: 4789)` changes it. The `#pragma warning(pop)` restores the pushed state, and removes the effects of the `#pragma warning(disable:4789)`. For more information about the C++ preprocessor directive `#pragma`, see [`warning`](../../preprocessor/warning.md) and [Pragma directives and the `__pragma` and `_Pragma` keywords](../../preprocessor/pragma-directives-and-the-pragma-keyword.md).

The [`/sdl` (Enable Additional Security Checks)](../../build/reference/sdl-enable-additional-security-checks.md) compiler option elevates this warning to an error.

Expand Down