/*
 * Code illustrating GCC extension to C which allows some
 * arrays whose size is not known until run-time to be
 * allocated on the stack (see file dynarray-gcc.s)
 */

int dynarray (int n) {
  int A[n];
  int sum, i;
  for (i = 0 ; i < n ; i++)
    A[i] = i;
  for (i = 0 ; i < n ; i++)
    sum += A[i];
  return sum;
}
