Skip to content

Structure error references in range [C1001, C1020] #5465

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 4 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
7 changes: 4 additions & 3 deletions docs/error-messages/compiler-errors-1/fatal-error-c1001.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
description: "Learn more about: Fatal Error C1001"
title: "Fatal Error C1001"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1001"
ms.date: 11/04/2016
f1_keywords: ["C1001"]
helpviewer_keywords: ["C1001"]
ms.assetid: 5736cdb3-22c8-4fad-aa85-d5e0d2b232f4
---
# Fatal Error C1001

> INTERNAL COMPILER ERROR(compiler file *file*, line *number*)

## Remarks

The compiler cannot generate correct code for a construct, often due to the combination of a particular expression and an optimization option, or an issue in parsing. If the compiler file listed has a utc or C2 path segment, it is probably an optimization error. If the file has a cxxfe or c1xx path segment, or is msc1.cpp, it is probably a parser error. If the file named is cl.exe, there is no other information available.

You can often fix an optimization problem by removing one or more optimization options. To determine which option is at fault, remove options one at a time and recompile until the error message goes away. The options most commonly responsible are [/Og (Global optimizations)](../../build/reference/og-global-optimizations.md) and [/Oi (Generate Intrinsic Functions)](../../build/reference/oi-generate-intrinsic-functions.md). Once you determine which optimization option is responsible, you can disable it around the function where the error occurs by using the [optimize](../../preprocessor/optimize.md) pragma, and continue to use the option for the rest of the module. For more information about optimization options, see [Optimization best practices](../../build/optimization-best-practices.md).
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1002.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Fatal Error C1002"
title: "Fatal Error C1002"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1002"
ms.date: 11/04/2016
f1_keywords: ["C1002"]
helpviewer_keywords: ["C1002"]
ms.assetid: bd6d274a-c7b4-43af-8bf2-23c5e442aa22
---
# Fatal Error C1002

compiler is out of heap space in pass 2
> compiler is out of heap space in pass 2

## Remarks

The compiler ran out of dynamic memory space during its second pass, probably due to a program with too many symbols or complex expressions.

Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1003.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1003"
title: "Fatal Error C1003"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1003"
ms.date: 11/04/2016
f1_keywords: ["C1003"]
helpviewer_keywords: ["C1003"]
ms.assetid: 27d2d009-2e0f-41fb-8bfc-372752fbe920
---
# Fatal Error C1003

error count exceeds number; stopping compilation
> error count exceeds number; stopping compilation

## Remarks

Errors in the program are too numerous to allow recovery. The compiler must terminate.
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/fatal-error-c1004.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Fatal Error C1004"
title: "Fatal Error C1004"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1004"
ms.date: 11/04/2016
f1_keywords: ["C1004"]
helpviewer_keywords: ["C1004"]
ms.assetid: dbe034b0-6eb0-41b4-a50c-2fccf9e78ad4
---
# Fatal Error C1004

unexpected end of file found
> unexpected end of file found

## Remarks

The compiler reached the end of a source file without resolving a construct. The code may be missing one of the following elements:

Expand All @@ -28,7 +29,9 @@ To resolve this error, check for the following:

- A source file does not end with a carriage return and line feed.

The following sample generates C1004:
## Example

The following example generates C1004:

```cpp
// C1004.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1005.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Fatal Error C1005"
title: "Fatal Error C1005"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1005"
ms.date: 11/04/2016
f1_keywords: ["C1005"]
helpviewer_keywords: ["C1005"]
ms.assetid: 150daf8e-a38a-4669-9c1a-a05b5a1f65ef
---
# Fatal Error C1005

string too big for buffer
> string too big for buffer

## Remarks

A string in a compiler intermediate file overflowed a buffer.

Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1007.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1007"
title: "Fatal Error C1007"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1007"
ms.date: 11/04/2016
f1_keywords: ["C1007"]
helpviewer_keywords: ["C1007"]
ms.assetid: 224f7e2c-4522-4e09-b455-8d293bdb799d
---
# Fatal Error C1007

unrecognized flag string in option
> unrecognized flag string in option

## Remarks

The command-line option contains an invalid string. Check the **CL** command line and environment variable for errors.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1008.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1008"
title: "Fatal Error C1008"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1008"
ms.date: 11/04/2016
f1_keywords: ["C1008"]
helpviewer_keywords: ["C1008"]
ms.assetid: 7de729e3-b2ca-4a68-95ab-8a1c920f3f2c
---
# Fatal Error C1008

no input file specified
> no input file specified

## Remarks

The compiler was not given a C or C++ source file to compile. Check the **CL** command line and environment variable for filename specifications.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1009.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1009"
title: "Fatal Error C1009"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1009"
ms.date: 11/04/2016
f1_keywords: ["C1009"]
helpviewer_keywords: ["C1009"]
ms.assetid: dcc8383c-3362-4c47-9c26-25d2451ebd53
---
# Fatal Error C1009

compiler limit : macros nested too deeply
> compiler limit : macros nested too deeply

## Remarks

The compiler tried to expand too many macros at the same time. The compiler has a limit of 256 levels of nested macros. Split nested macros into simpler macros.
5 changes: 2 additions & 3 deletions docs/error-messages/compiler-errors-1/fatal-error-c1010.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Fatal Error C1010"
title: "Fatal Error C1010"
ms.date: "09/03/2019"
description: "Learn more about: Fatal Error C1010"
ms.date: 09/03/2019
f1_keywords: ["C1010"]
helpviewer_keywords: ["C1010"]
ms.assetid: dfd035f1-a7a2-40bc-bc92-dc4d7f456767
---
# Fatal Error C1010

Expand Down
2 changes: 1 addition & 1 deletion docs/error-messages/compiler-errors-1/fatal-error-c1011.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: Fatal Error C1011"
title: "Fatal Error C1011"
description: "Learn more about: Fatal Error C1011"
ms.date: 08/17/2022
f1_keywords: ["C1011"]
helpviewer_keywords: ["C1011"]
Expand Down
10 changes: 7 additions & 3 deletions docs/error-messages/compiler-errors-1/fatal-error-c1012.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
---
title: "Fatal Error C1012"
description: "Learn more about: Fatal Error C1012"
ms.date: "02/20/2025"
ms.date: 02/20/2025
f1_keywords: ["C1012"]
helpviewer_keywords: ["C1012"]
---
# Fatal Error C1012

unmatched parenthesis: missing 'character'
> unmatched parenthesis: missing 'character'

## Remarks

The parentheses in a preprocessor directive do not match.

The following sample generates C1012:
## Example

The following example generates C1012:

```cpp
// C1012.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1013.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Fatal Error C1013"
title: "Fatal Error C1013"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1013"
ms.date: 11/04/2016
f1_keywords: ["C1013"]
helpviewer_keywords: ["C1013"]
ms.assetid: 5514a679-efe7-4055-bdd3-5693ca0c332f
---
# Fatal Error C1013

compiler limit : too many open parentheses
> compiler limit : too many open parentheses

## Remarks

An expression contains too many levels of parentheses in a single expression. Simplify the expression or break it into multiple statements.

Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1014.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1014"
title: "Fatal Error C1014"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1014"
ms.date: 11/04/2016
f1_keywords: ["C1014"]
helpviewer_keywords: ["C1014"]
ms.assetid: 4c01ef70-e765-4d07-a3fe-a11c19fb610b
---
# Fatal Error C1014

too many include files : depth = level
> too many include files : depth = level

## Remarks

The nesting of `#include` directives is too deep. Nested directives can include open files. The source file containing the directive counts as one file.
2 changes: 2 additions & 0 deletions docs/error-messages/compiler-errors-1/fatal-error-c1015.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ helpviewer_keywords: ["C1015"]

> header-names '*header-name*' and '*header-name*' identify the same header and cannot be used as both `/headerUnit:quote` and `/headerUnit:angle` arguments; please provide this header-name only once

## Remarks

Don't include a header unit using both double-quotes and angle brackets. Use only one form, consistent with the **`/headerUnit:quote`** or **`/headerUnit:angle`** compiler option. For more information, see [`/headerUnit` (Use header unit IFC)](../../build/reference/headerunit.md).
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/fatal-error-c1016.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Fatal Error C1016"
title: "Fatal Error C1016"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1016"
ms.date: 11/04/2016
f1_keywords: ["C1016"]
helpviewer_keywords: ["C1016"]
ms.assetid: 33f45c3e-2d8f-43ad-a445-c412d1d54ce1
---
# Fatal Error C1016

\#ifdef expected an identifier#ifndef expected an identifier
> #ifdef expected an identifier#ifndef expected an identifier

## Remarks

The conditional compilation directive ([#ifdef](../../preprocessor/hash-ifdef-and-hash-ifndef-directives-c-cpp.md) or `#ifndef`) has no identifier to evaluate. To resolve the error, specify an identifier.

The following sample generates C1016:
## Example

The following example generates C1016:

```cpp
// C1016.cpp
Expand Down
15 changes: 9 additions & 6 deletions docs/error-messages/compiler-errors-1/fatal-error-c1017.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Fatal Error C1017"
title: "Fatal Error C1017"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1017"
ms.date: 11/04/2016
f1_keywords: ["C1017"]
helpviewer_keywords: ["C1017"]
ms.assetid: 5542e604-599d-4e36-8f83-1d454c5753c9
---
# Fatal Error C1017

invalid integer constant expression
> invalid integer constant expression

## Remarks

The expression in an `#if` directive did not exist or did not evaluate to a constant.

Constants defined using `#define` must have values that evaluate to an integer constant if they are used in an `#if`, `#elif`, or `#else` directive.

The following sample generates C1017:
## Example

The following example generates C1017:

```cpp
// C1017.cpp
Expand All @@ -35,7 +38,7 @@ Possible resolution:

Because `CONSTANT_NAME` evaluates to a string and not an integer, the `#if` directive generates fatal error C1017.

In other cases, the preprocessor evaluates an undefined constant as zero. This can cause unintended results, as shown in the following sample. `YES` is undefined, so it evaluates to zero. The expression `#if` `CONSTANT_NAME` evaluates to false and the code to be used on `YES` is removed by the preprocessor. `NO` is also undefined (zero), so `#elif` `CONSTANT_NAME==NO` evaluates to true (`0 == 0`), causing the preprocessor to leave the code in the `#elif` portion of the statement — exactly the opposite of the intended behavior.
In other cases, the preprocessor evaluates an undefined constant as zero. This can cause unintended results, as shown in the following example. `YES` is undefined, so it evaluates to zero. The expression `#if` `CONSTANT_NAME` evaluates to false and the code to be used on `YES` is removed by the preprocessor. `NO` is also undefined (zero), so `#elif` `CONSTANT_NAME==NO` evaluates to true (`0 == 0`), causing the preprocessor to leave the code in the `#elif` portion of the statement — exactly the opposite of the intended behavior.

```cpp
// C1017c.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/fatal-error-c1018.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Fatal Error C1018"
title: "Fatal Error C1018"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1018"
ms.date: 11/04/2016
f1_keywords: ["C1018"]
helpviewer_keywords: ["C1018"]
ms.assetid: 2ceb8a99-30b2-4b80-bf42-e9f3305b3c52
---
# Fatal Error C1018

unexpected #elif
> unexpected #elif

## Remarks

The `#elif` directive appears outside an `#if`, `#ifdef`, or `#ifndef` construct. Use `#elif` only within one of these constructs.

The following sample generates C1018:
## Example

The following example generates C1018:

```cpp
// C1018.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/fatal-error-c1019.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Fatal Error C1019"
title: "Fatal Error C1019"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1019"
ms.date: 11/04/2016
f1_keywords: ["C1019"]
helpviewer_keywords: ["C1019"]
ms.assetid: c4f8968b-bc62-4200-b3ca-69d06c163236
---
# Fatal Error C1019

unexpected #else
> unexpected #else

## Remarks

The `#else` directive appears outside an `#if`, `#ifdef`, or `#ifndef` construct. Use `#else` only within one of these constructs.

The following sample generates C1019:
## Example

The following example generates C1019:

```cpp
// C1019.cpp
Expand Down
Loading