4

When the size of my input is big enough, segmentation fault sprouts where variable-length arrays are used in a project. I want to remove them all, how to make GCC display every declaration it finds of a variable-length array?

I have tried using -Wstack-usage=1000 and filtering for the message warning: stack usage might be unbounded, but that gives me the function, not the declaration. Is there a better way?

barak manos
  • 29,648
  • 10
  • 62
  • 114
lvella
  • 12,754
  • 11
  • 54
  • 106

1 Answers1

8

I was pretty sure I have done that before, and thanks to the comments I found the solution again: use -Wvla compiler switch.

lvella
  • 12,754
  • 11
  • 54
  • 106