I have a 2D array `A` and a pointer `ptr` pointing somewhere inside it. I know how to compute the row number but the actual type of the expression seems non-portable:

```
#include <stdio.h>

int main(void) {
    int A[100][100];
    int *ptr = &A[42][24];

    printf("row number is %d\n", (ptr - A[0]) / (sizeof(A[0]) / sizeof(A[0][0])));
    printf("col number is %d\n", (ptr - A[0]) % (sizeof(A[0]) / sizeof(A[0][0])));
    return 0;
}

```

On OS/X, the `clang` compiler complains this way:

```
warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]

```

On Linux, `gcc` gives a similar warning, but on Windows, I get a different diagnostic:

```
warning: format specifies type 'int' but the argument has type 'unsigned long long' [-Wformat]

```

What is the actual type of this expression?

Is there a way to pass the expression to `printf` without an ugly cast?