IBM Support

Variable length arrays with private semantics in OpenMP task constructs

Troubleshooting


Problem

The IBM XL C/C++ V10.1 compilers do not support variable length arrays that have private semantics in an OpenMP task construct.

Symptom

When a variable length array (VLA) has private semantics in an OpenMP task construct, the IBM XL C/C++ compilers will issue a severe error.

For example, the following code will issue a severe error:

    +1  int main()
    +2  {
    +3    int n=10;
    +4    int a[n];
    +5  #pragma omp parallel num_threads(3)
    +6    {
    +7  #pragma omp task private(a)
    +8        {
    +9          a[7]=11;
   +10        }
   +11    }
   +12  }
C: "t1.c", line 7.26: 1506-002 (S) COMPILER ERROR: Feature not implemented: private variable length array variable in omp task construct: a.
C++: "t1.c", line 7.26: 1540-2903 (S) A variable length array may not be specified in an OpenMP "private" clause.

Resolving The Problem

Ensure your code does not use these constructs.

[{"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Compiler","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"}],"Version":"10.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
08 August 2018

UID

swg21313058