From fbc80bb33a208e59f333bd12f1861c83a1bd2f1a Mon Sep 17 00:00:00 2001 From: Colin Robertson Date: Mon, 26 Apr 2021 13:43:10 -0700 Subject: [PATCH 1/2] Update /FC for VC2019 per JonEmmett --- ...path-of-source-code-file-in-diagnostics.md | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md b/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md index d9bf6b5b0d1..3a654c138e1 100644 --- a/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md +++ b/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md @@ -1,43 +1,53 @@ --- -description: "Learn more about: /FC (Full Path of Source Code File in Diagnostics)" -title: "/FC (Full Path of Source Code File in Diagnostics)" -ms.date: "11/04/2016" -f1_keywords: ["VC.Project.VCCLCompilerTool.UseFullPaths", "/FC"] +description: "Learn more about: /FC (Full path of source code file in diagnostics)" +title: "/FC (Full path of source code file in diagnostics)" +ms.date: 04/26/2021 +f1_keywords: ["VC.Project.VCCLCompilerTool.UseFullPaths", "/FC", "-FC"] helpviewer_keywords: ["/FC compiler option [C++]", "-FC compiler option [C++]"] ms.assetid: 1f11414e-cb42-421b-be68-9d369aab036b --- -# /FC (Full Path of Source Code File in Diagnostics) +# `/FC` (Full path of source code file in diagnostics) Causes the compiler to display the full path of source code files passed to the compiler in diagnostics. ## Syntax -> /FC +> **`/FC`** ## Remarks -Consider the following code sample: +Consider the following code sample, where the source file is located in *`C:\test\compiler_option_FC.cpp`*: ```cpp // compiler_option_FC.cpp + int main( ) { int i // C2143 } ``` -Without **/FC**, the diagnostic text would look similar to this diagnostic text: +Without **`/FC`**, the compiler output looks similar to this diagnostic text: + +- compiler_option_FC.cpp(5): error C2143: syntax error: missing ';' before '}' + +With **`/FC`**, the compiler output looks similar to this diagnostic text: + +::: moniker range="<=msvc-150" + +- c:\test\compiler_option_fc.cpp(5): error C2143: syntax error: missing ';' before '}' -- compiler_option_FC.cpp(5) : error C2143: syntax error : missing ';' before '}' +::: moniker-end +::: moniker range="msvc-160" -With **/FC**, the diagnostic text would look similar to this diagnostic text: +- C:\test\compiler_option_FC.cpp(5): error C2143: syntax error: missing ';' before '}' -- c:\test\compiler_option_fc.cpp(5) : error C2143: syntax error : missing ';' before '}' +::: moniker-end -**/FC** is also needed if you want to see the full path of a file name when using the __FILE__ macro. See [Predefined Macros](../../preprocessor/predefined-macros.md) for more information on __FILE__. +**`/FC`** is also needed if you want to see the full path of a file name when using the `__FILE__` macro. For more information about `__FILE__`, see [Predefined macros](../../preprocessor/predefined-macros.md). -The **/FC** option is implied by **/ZI**. For more information about **/ZI**, see [/Z7, /Zi, /ZI (Debug Information Format)](z7-zi-zi-debug-information-format.md). +The **`/FC`** option is implied by **`/ZI`**. For more information about **`/ZI`**, see [`/Z7, /Zi, /ZI` (Debug information format)](z7-zi-zi-debug-information-format.md). -**/FC** outputs full paths in lower case. +In Visual Studio 2017 and earlier versions, **`/FC`** outputs full paths in lower case. Starting in Visual Studio 2019, **`/FC`** preserves the casing of full paths in the file system. ### To set this compiler option in the Visual Studio development environment @@ -47,11 +57,11 @@ The **/FC** option is implied by **/ZI**. For more information about **/ZI**, se 1. Modify the **Use Full Paths** property. -### To set this linker option programmatically +### To set this compiler option programmatically - See . ## See also -[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md) +[MSVC compiler options](compiler-options.md)\ +[MSVC compiler command-line syntax](compiler-command-line-syntax.md) From af4b0edceaf0e0e8ee818e9f6226edac1553e671 Mon Sep 17 00:00:00 2001 From: Colin Robertson Date: Mon, 26 Apr 2021 13:59:23 -0700 Subject: [PATCH 2/2] Readability tweak. --- .../fc-full-path-of-source-code-file-in-diagnostics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md b/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md index 3a654c138e1..5cc1c4a4eba 100644 --- a/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md +++ b/docs/build/reference/fc-full-path-of-source-code-file-in-diagnostics.md @@ -47,7 +47,7 @@ With **`/FC`**, the compiler output looks similar to this diagnostic text: The **`/FC`** option is implied by **`/ZI`**. For more information about **`/ZI`**, see [`/Z7, /Zi, /ZI` (Debug information format)](z7-zi-zi-debug-information-format.md). -In Visual Studio 2017 and earlier versions, **`/FC`** outputs full paths in lower case. Starting in Visual Studio 2019, **`/FC`** preserves the casing of full paths in the file system. +In Visual Studio 2017 and earlier versions, **`/FC`** outputs full paths in lower case. Starting in Visual Studio 2019, **`/FC`** uses the same casing as the file system for full paths. ### To set this compiler option in the Visual Studio development environment