Skip to content

Structure error references in range [C3011, C3030] #5654

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

Merged
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
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3011.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3011"
title: "Compiler Error C3011"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3011"
ms.date: 11/04/2016
f1_keywords: ["C3011"]
helpviewer_keywords: ["C3011"]
ms.assetid: 24c3a917-ebff-4deb-9155-23adf6468531
---
# Compiler Error C3011

inline assembly not allowed directly within a parallel region
> inline assembly not allowed directly within a parallel region

## Remarks

An `omp` parallel region cannot contain inline assembly instructions.

The following sample generates C3011:
## Example

The following example generates C3011:

```cpp
// C3011.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3012.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3012"
title: "Compiler Error C3012"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3012"
ms.date: 11/04/2016
f1_keywords: ["C3012"]
helpviewer_keywords: ["C3012"]
ms.assetid: cc7040b1-b3fb-4da6-a474-877914d30332
---
# Compiler Error C3012

> '*intrinsic*' : intrinsic function not allowed directly within a parallel region

## Remarks

A [compiler intrinsic](../../intrinsics/compiler-intrinsics.md) function is not allowed in an `omp parallel` region. To fix this issue, move intrinsics out of the region, or replace them with non-intrinsic equivalents.

## Example

The following sample generates C3012, and shows one way to fix it:
The following example generates C3012, and shows one way to fix it:

```cpp
// C3012.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3013.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3013"
title: "Compiler Error C3013"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3013"
ms.date: 11/04/2016
f1_keywords: ["C3013"]
helpviewer_keywords: ["C3013"]
ms.assetid: f896777d-27e6-4b6d-baab-1567317f3374
---
# Compiler Error C3013

'clause' : clause may only appear once on OpenMP 'directive' directive
> 'clause' : clause may only appear once on OpenMP 'directive' directive

## Remarks

A clause appeared twice on the same directive. Delete one occurrence of the clause.

The following sample generates C3013:
## Example

The following example generates C3013:

```cpp
// C3013.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3014.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3014"
title: "Compiler Error C3014"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3014"
ms.date: 11/04/2016
f1_keywords: ["C3014"]
helpviewer_keywords: ["C3014"]
ms.assetid: af1c5b0c-dbf9-4274-b06a-c6c2cdcf2a52
---
# Compiler Error C3014

expected a for loop following OpenMP 'directive' directive
> expected a for loop following OpenMP 'directive' directive

## Remarks

It is an error for anything other than a **`for`** loop to immediately follow a `#pragma omp for` directive.

The following sample generates C3014:
## Example

The following example generates C3014:

```cpp
// C3014.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3015.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3015"
title: "Compiler Error C3015"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3015"
ms.date: 11/04/2016
f1_keywords: ["C3015"]
helpviewer_keywords: ["C3015"]
ms.assetid: d5e8e50b-7542-4b2d-8665-1b22072a5bc6
---
# Compiler Error C3015

initialization in OpenMP 'for' statement has improper form
> initialization in OpenMP 'for' statement has improper form

## Remarks

A **`for`** loop in an OpenMP statement must be fully and explicitly specified.

The following sample generates C3015:
## Example

The following example generates C3015:

```cpp
// C3015.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3016.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3016"
title: "Compiler Error C3016"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3016"
ms.date: 11/04/2016
f1_keywords: ["C3016"]
helpviewer_keywords: ["C3016"]
ms.assetid: 3423467e-e8bb-4f35-b4db-7925cafa74c1
---
# Compiler Error C3016

'var' : index variable in OpenMP 'for' statement must have signed integral type
> 'var' : index variable in OpenMP 'for' statement must have signed integral type

## Remarks

The index variable in an OpenMP **`for`** statement must be a signed integral type.

The following sample generates C3016:
## Example

The following example generates C3016:

```cpp
// C3016.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3017.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3017"
title: "Compiler Error C3017"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3017"
ms.date: 11/04/2016
f1_keywords: ["C3017"]
helpviewer_keywords: ["C3017"]
ms.assetid: 12ab2c2a-d0d2-4900-9cbf-39be0af590dd
---
# Compiler Error C3017

termination test in OpenMP 'for' statement has improper form
> termination test in OpenMP 'for' statement has improper form

## Remarks

A **`for`** loop in an OpenMP statement must be fully and explicitly specified.

The following sample generates C3017:
## Example

The following example generates C3017:

```cpp
// C3017.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3018.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3018"
title: "Compiler Error C3018"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3018"
ms.date: 11/04/2016
f1_keywords: ["C3018"]
helpviewer_keywords: ["C3018"]
ms.assetid: 685be45f-f116-43a8-a88d-05ab6616e2f1
---
# Compiler Error C3018

'var1' : OpenMP 'for' test or increment must use index variable 'var2'
> 'var1' : OpenMP 'for' test or increment must use index variable 'var2'

## Remarks

A **`for`** loop in an OpenMP statement must use the same variable for its test and increment as it uses for its index.

The following sample generates C3018:
## Example

The following example generates C3018:

```cpp
// C3018.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3019.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3019"
title: "Compiler Error C3019"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3019"
ms.date: 11/04/2016
f1_keywords: ["C3019"]
helpviewer_keywords: ["C3019"]
ms.assetid: 31a6d9b6-d29f-4499-9ad8-48dd751e87c7
---
# Compiler Error C3019

increment in OpenMP 'for' statement has improper form
> increment in OpenMP 'for' statement has improper form

## Remarks

The increment part of an OpenMP **`for`** loop must use the index variable both on the left and right side of the operator.

The following sample generates C3019:
## Example

The following example generates C3019:

```cpp
// C3019.cpp
Expand Down
17 changes: 10 additions & 7 deletions docs/error-messages/compiler-errors-2/compiler-error-c3020.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3020"
title: "Compiler Error C3020"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3020"
ms.date: 11/04/2016
f1_keywords: ["C3020"]
helpviewer_keywords: ["C3020"]
ms.assetid: f625c7a3-afaa-4bd8-9c1b-51891b832f36
---
# Compiler Error C3020

'var' : index variable of OpenMP 'for' loop cannot be modified in loop body
> 'var' : index variable of OpenMP 'for' loop cannot be modified in loop body

## Remarks

An OpenMP **`for`** loop may not modify the index (loop counter) in the body of the **`for`** loop.

The following sample generates C3020:
## Examples

The following example generates C3020:

```cpp
// C3020.cpp
Expand All @@ -33,7 +36,7 @@ int main() {

A variable declared with [lastprivate](../../parallel/openmp/reference/openmp-clauses.md#lastprivate) cannot be used as the index inside a parallelized loop.

The following sample will give C3020 for the second lastprivate because that lastprivate will trigger a write to idx_a within the outermost for loop. The first lastprivate doesn't give an error because that lastprivate triggers a write to idx_a outside the outermost for loop (technically, at the very end of the last iteration). The following sample generates C3020.
The following example will give C3020 for the second lastprivate because that lastprivate will trigger a write to idx_a within the outermost for loop. The first lastprivate doesn't give an error because that lastprivate triggers a write to idx_a outside the outermost for loop (technically, at the very end of the last iteration). The following example generates C3020.

```cpp
// C3020b.cpp
Expand All @@ -52,7 +55,7 @@ void test(int first, int last)
}
```

The following sample demonstrates a possible resolution:
The following example demonstrates a possible resolution:

```cpp
// C3020c.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3021.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3021"
title: "Compiler Error C3021"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3021"
ms.date: 11/04/2016
f1_keywords: ["C3021"]
helpviewer_keywords: ["C3021"]
ms.assetid: 0cef6d97-e267-438a-ac8b-0daf5bbbc2cf
---
# Compiler Error C3021

'arg' : argument is empty on OpenMP directive 'directive'
> 'arg' : argument is empty on OpenMP directive 'directive'

## Remarks

An argument is required for an OpenMP directive.

## Example

The following sample generates C3021:
The following example generates C3021:

```cpp
// C3021.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3022.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3022"
title: "Compiler Error C3022"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3022"
ms.date: 11/04/2016
f1_keywords: ["C3022"]
helpviewer_keywords: ["C3022"]
ms.assetid: 9f1d444c-6c6e-48d9-9346-69128390aa33
---
# Compiler Error C3022

'clause' : invalid schedule kind of 'value' on OpenMP 'directive' directive
> 'clause' : invalid schedule kind of 'value' on OpenMP 'directive' directive

## Remarks

An unsupported value was passed to a clause.

The following sample generates C3022:
## Example

The following example generates C3022:

```cpp
// C3022.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3023.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3023"
title: "Compiler Error C3023"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3023"
ms.date: 11/04/2016
f1_keywords: ["C3023"]
helpviewer_keywords: ["C3023"]
ms.assetid: 89dcce98-3cd7-4931-a50f-87df1d2ebc9b
---
# Compiler Error C3023

'value' : unexpected token encountered in argument to OpenMP 'clause' clause
> 'value' : unexpected token encountered in argument to OpenMP 'clause' clause

## Remarks

The values passed to a clause were not valid.

The following sample generates C3023:
## Example

The following example generates C3023:

```cpp
// C3023.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3024.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3024"
title: "Compiler Error C3024"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3024"
ms.date: 11/04/2016
f1_keywords: ["C3024"]
helpviewer_keywords: ["C3024"]
ms.assetid: 1c031c28-ce37-4de3-aead-cfe76b261856
---
# Compiler Error C3024

'schedule(runtime)' : chunk_size expression is not allowed
> 'schedule(runtime)' : chunk_size expression is not allowed

## Remarks

A value cannot be passed to the run-time parameter of the schedule clause.

The following sample generates C3024:
## Example

The following example generates C3024:

```cpp
// C3024.cpp
Expand Down
Loading