Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#define MAX_ARRAY 1024

void func(size_t s) {
   int vla[s];
   ...
}

...
if (s < MAX_ARRAY && s != 0) {
   func(s);
} else {
   /* Handle Error */
}
...

References

Griffiths 06 Clutching at straws: When you can shift the stack pointer