How to get rid of "warning: initialization from incompatible pointer type [-Wincompatible-pointer-types"]