Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.81 KB

c-preserve-comments-during-preprocessing.md

File metadata and controls

56 lines (39 loc) · 1.81 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: /C (Preserve Comments During Preprocessing)
/C (Preserve Comments During Preprocessing)
11/04/2016
VC.Project.VCCLCompilerTool.KeepComments
VC.Project.VCCLWCECompilerTool.KeepComments
comments, not stripping during preprocessing
preserve comments during preprocessing
-c compiler option [C++]
c compiler option [C++]
/c compiler option [C++]
944567ca-16bc-4728-befe-d414a7787f26

/C (Preserve Comments During Preprocessing)

Preserves comments during preprocessing.

Syntax

/C

Remarks

This compiler option requires the /E, /P, or /EP option.

The following code sample will display the source code comment.

// C_compiler_option.cpp
// compile with: /E /C /c
int i;   // a variable

This sample will produce the following output.

#line 1 "C_compiler_option.cpp"
int i;   // a variable

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > C/C++ > Preprocessor property page.

  3. Modify the Keep Comments property.

To set this compiler option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.KeepComments%2A.

See also

MSVC Compiler Options
MSVC Compiler Command-Line Syntax
/E (Preprocess to stdout)
/P (Preprocess to a File)
/EP (Preprocess to stdout Without #line Directives)