Skip to content

Commit 055bafe

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2851, C2880]
1 parent 96a245b commit 055bafe

24 files changed

+74
-4
lines changed

docs/error-messages/compiler-errors-2/compiler-error-c2854.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 917fec9c-790a-4149-8dfc-00d17a09199c
1010

1111
> syntax error in #pragma hdrstop
1212
13+
## Remarks
14+
1315
The `#pragma hdrstop` gives an invalid filename. The pragma can be followed by an optional filename in parentheses and quotation marks:
1416

17+
## Example
18+
1519
The following sample generates C2854:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c2855.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ helpviewer_keywords: ["C2855"]
99

1010
> command-line option '*option*' inconsistent with precompiled header
1111
12-
This error occurs when a command-line option differs from the options used to create the precompiled header.
13-
1412
## Remarks
1513

14+
This error occurs when a command-line option differs from the options used to create the precompiled header.
15+
1616
Error C2855 can occur when you make an incremental build after changing a compiler option. It can also happen if you set specific compiler options for individual source files.
1717

1818
To resolve this error, regenerate the precompiled header by using the specified command-line option. To regenerate the precompiled header, build the associated source file. For example, projects created by a Visual Studio template usually create a source file named *`pch.cpp`* to generate the precompiled header. (In older versions of Visual Studio, this file is named *`stdafx.cpp`*.) In other projects, the source file to rebuild is the one built by using the [`/Yc` (Create precompiled header file)](../../build/reference/yc-create-precompiled-header-file.md) compiler option. We recommend you rebuild your entire project after making a change to the precompiled header.

docs/error-messages/compiler-errors-2/compiler-error-c2856.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: fe616c51-124e-49e3-9dd8-883ec1660680
1010

1111
> #pragma hdrstop cannot be inside an #if block
1212
13+
## Remarks
14+
1315
The `hdrstop` pragma cannot be placed inside the body of a conditional compilation block.
1416

1517
Move the `#pragma hdrstop` statement to an area that is not contained in an `#if/#endif` block.

docs/error-messages/compiler-errors-2/compiler-error-c2857.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ms.assetid: b57302bd-58ec-45ae-992a-1e282d5eeccc
1010

1111
> '#include' statement specified with the /Yc*filename* command-line option was not found in the source file
1212
13-
The [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option specifies the name of an include file that is not included in the source file being compiled.
14-
1513
## Remarks
1614

15+
The [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option specifies the name of an include file that is not included in the source file being compiled.
16+
1717
When you use the **/Yc**<em>filename</em> option on a source file to create a precompiled header (PCH) file, that source file must include the *filename* header file. Every file included by the source file, up to and including the specified *filename*, is included in the PCH file. In other source files compiled by using the **/Yu**<em>filename</em> option to use the PCH file, an include of *filename* must be the first non-comment line in the file. The compiler ignores anything in the source file before this include.
1818

1919
This error can be caused by an `#include "filename"` statement in a conditional compilation block that is not compiled in your PCH source file.

docs/error-messages/compiler-errors-2/compiler-error-c2858.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 1fb1d770-307e-476e-9984-a1d8f8ce2820
1010

1111
> command-line option '/Yc (/Fd*filename1*)' inconsistent with precompiled header, which used '/Fd*filename2*'
1212
13+
## Remarks
14+
1315
The program database specified by the Use Precompiled Header ([`/Yu`](../../build/reference/yu-use-precompiled-header-file.md)) option is not the one specified by the previous Create Precompiled Header ([`/Yc`](../../build/reference/yc-create-precompiled-header-file.md)) option.
1416

1517
This error is obsolete in Visual Studio 2022 and later versions.

docs/error-messages/compiler-errors-2/compiler-error-c2859.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: fcfbc58d-08f6-4752-9688-8aaac517e684
1010

1111
> filename is not the type file that was used when this precompiled header was created, recreate the precompiled header.
1212
13+
## Remarks
14+
1315
The project database and precompiled header files must be created together to ensure consistent information. Rebuild the project to recreate the precompiled header.
1416

1517
For information on precompiled headers, see [/Y (Precompiled Headers)](../../build/reference/y-precompiled-headers.md).

docs/error-messages/compiler-errors-2/compiler-error-c2860.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2860"]
99

1010
> 'void' cannot be used as a function parameter except for '(void)'
1111
12+
## Remarks
13+
1214
A function parameter cannot be of type **`void`**.
1315

16+
## Example
17+
1418
The following sample generates C2860:
1519

1620
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c2861.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 012bb44d-6c9b-4def-b54e-b19f1f8ddd1b
1010

1111
> 'function name' : an interface member function cannot be defined
1212
13+
## Remarks
14+
1315
The compiler encountered the interface keyword or deduced a struct as an interface but then found a member function definition. An interface cannot contain a definition for a member function.
1416

1517
## Example

docs/error-messages/compiler-errors-2/compiler-error-c2862.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: c04d8499-b799-48a1-9fb4-7902a0b0ac8e
1010

1111
> 'interface' : an interface can only have public members
1212
13+
## Remarks
14+
1315
Protected and private members may be accessed only from other member functions. Such members are no use in an interface, since it may not provide implementations for any of its members.
1416

17+
## Example
18+
1519
The following sample will generate C2862:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c2863.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 32561d67-a795-486b-b3b6-4b90a1acb176
1010

1111
> 'interface' : an interface cannot have friends
1212
13+
## Remarks
14+
1315
Declaring friends on an interface is not allowed.
1416

17+
## Example
18+
1519
The following sample generates C2863:
1620

1721
```cpp

0 commit comments

Comments
 (0)