Add -Wpointer-arith flag to prevent problems with pointer arithmetic on void*
Fix errors after enabling -Wpointer-arith