Mercurial > illumos > git > illumos-gate
view usr/src/tools/smatch/src/validation/vla-sizeof4.c @ 19241:79022555a4a9
11972 resync smatch
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Dan McDonald <danmcd@joyent.com>
author | John Levon <john.levon@joyent.com> |
---|---|
date | Mon, 11 Nov 2019 16:23:50 +0000 |
parents | |
children |
line wrap: on
line source
#define N 2 #define T int static unsigned long foo(int x, int y) { T a[x][y]; return sizeof(a) == (x * (y * sizeof(T))); } /* * check-name: vla-sizeof var X var * check-command: test-linearize -Wvla $file * * check-output-ignore * check-output-contains: ret\\..*\\$1 * * check-error-start vla-sizeof4.c:6:16: warning: Variable length array is used. vla-sizeof4.c:6:13: warning: Variable length array is used. * check-error-end */