flags: -g -Wall -Wextra -std=c99 -pedantic
The following code compiles and runs (for me at least) with no errors. Tried with both stack and heap allocated arrays of various sizes.
#include <stdlib.h>
void foo(int array[static 10]) {
(void) array; // suppress unused var compiler warning
return;
}
int main () {
int *x = calloc(10, sizeof(int));
int *y = calloc(9, sizeof(int));
int *z = calloc(11, sizeof(int));
foo(x);
foo(y);
foo(z);
foo(NULL);
int a[9];
int b[4];
int c[11];
foo(a);
foo(b);
foo(c);
return 0;
}