SQLite Forum

Compiler warnings in shell.c on ArraySize(p->actualWidth)
Login
Compiling [445ed5dab2c2](https://sqlite.org/src/info/445ed5dab2c2) with `clang`, getting apparently legit warnings, effectively due to `sizeof(arrptr)`, with arrptr being dynamically alloc'ed array kind. Thus `sizeof()` is equivalent to `sizeof(void*)`, which is probably not what's intended.

Here's __one of__ the affected lines [shell.c.in:2057](https://sqlite.org/src/file?udc=1&ln=2057&ci=445ed5dab2c26e9f&name=src%2Fshell.c.in)

```
shell.c:10616:11: warning: 'sizeof (p->actualWidth)' will return the size of the
      pointer, not the array itself [-Wsizeof-pointer-div]
    if( i<ArraySize(p->actualWidth) ){
          ^~~~~~~~~~~~~~~~~~~~~~~~~
shell.c:402:38: note: expanded from macro 'ArraySize'
#define ArraySize(X)  (int)(sizeof(X)/sizeof(X[0]))
                            ~~~~~~~~~^
shell.c:10713:17: warning: 'sizeof (p->actualWidth)' will return the size of the
      pointer, not the array itself [-Wsizeof-pointer-div]
          if( i<ArraySize(p->actualWidth) ){
                ^~~~~~~~~~~~~~~~~~~~~~~~~
shell.c:10724:19: warning: 'sizeof (p->actualWidth)' will return the size of the
      pointer, not the array itself [-Wsizeof-pointer-div]
            if( i<ArraySize(p->actualWidth) ){
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
shell.c:10735:19: warning: 'sizeof (p->actualWidth)' will return the size of the
      pointer, not the array itself [-Wsizeof-pointer-div]
            if( i<ArraySize(p->actualWidth) ){
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
shell.c:10760:15: warning: 'sizeof (p->actualWidth)' will return the size of the
      pointer, not the array itself [-Wsizeof-pointer-div]
        if( i<ArraySize(p->actualWidth) ){
              ^~~~~~~~~~~~~~~~~~~~~~~~~
```