Ive been using a workaround for some time that works fine for me.
Replace the line
int *array = (int *)malloc(100 * sizeof(int));
with
int *array = (int *)malloc((int)sizeof(int) * 100);
or if you wanted floats use
float *array = (float *)malloc((int)sizeof(float) * 100);
Putting the (int) in front of the sizeof() typecasts it into an integer and Ive found it then works fine in arithmetic.
If anyoneone wants to dis-agree, let me know as I may need to change a lot of my old coding...