vla-sizeof3.c 377 B

12345678910111213141516171819202122
  1. #define N 2UL
  2. #define T int
  3. static unsigned long foo(int x)
  4. {
  5. T a[x][N];
  6. return sizeof(a) == (N * x * sizeof(T));
  7. }
  8. /*
  9. * check-name: vla-sizeof var X cte
  10. * check-command: test-linearize -Wvla $file
  11. *
  12. * check-output-ignore
  13. * check-output-contains: ret\\..*\\$1
  14. *
  15. * check-error-start
  16. vla-sizeof3.c:6:13: warning: Variable length array is used.
  17. * check-error-end
  18. */