cpp: #include <stdlib.h>\n#include <stdio.h>\n\nvoid foo(int n, int * restrict  a, int * restrict b, int * restrict  c)\n{\n  int i;\n#pragma omp parallel for \n  for (i = 0; i < n; i++)\n    a[i] = b[i] + c[i];  \n}\n\nint main()\n{\n  int n = 1000;\n  int * a , *b, *c;\n\n  a = (int*) malloc (n* sizeof (int));\n  if (a ==0)\n  {\n    fprintf (stderr, "skip the execution due to malloc failures.\n");\n    return 1;\n  }\n\n  b = (int*) malloc (n* sizeof (int));\n  if (b ==0)\n  {\n    fprintf (stderr, "skip the execution due to malloc failures.\n");\n    return 1;\n  }\n\n  c = (int*) malloc (n* sizeof (int));\n  if (c ==0)\n  {\n    fprintf (stderr, "skip the execution due to malloc failures.\n");\n    return 1;\n  }\n\n  foo (n, a, b,c);\n\n  free (a);\n  free (b);\n  free (c);\n  return 0;\n}  \n\n
fortran: program DRB068_restrictpointer2_orig_no\n    use omp_lib\n    use DRB068\n    implicit none\n\n    integer :: n = 1000\n    integer, dimension(:), pointer :: a=>null(), b=>null(), c=>null(), d=>null()\n\n    allocate (a(n))\n    allocate (b(n))\n    allocate (c(n))\n    allocate (d(n))\n\n    call foo(n,a,b,c,d)\n\n    if(associated(a))nullify(a)\n    if(associated(b))nullify(b)\n    if(associated(c))nullify(c)\n    if(associated(d))nullify(d)\n\nend program