Then don't allow it to decay:
void arr_fn(char (*arr)[15]) {
enum { len = sizeof *arr }; printf("len of array: %d\n", len);
printf("Got: %.*s\n", len, *arr);
}
void sptr_fn(char ptr[static 15]) { printf("Got: %s\n", ptr); }
int main(void) {
char array[15] = "Hello, World!";
arr_fn(&array); sptr_fn(array); return 0;
}
Using gcc (and similarly clang) removing the '15' from 'array', and allowing it to allocate it as 14 chars will result in warnings for both function calls.
One can hide that ptr to array behind a typedef to make it more readable:
typedef char (Arr_15)[15];
void arr_fn2(Arr_15 *arr) {
What do you mean by 'the static trick'? Is that what I have in sptr_fn()?