I have this piece of code:
...
#include <stdlib.h>
...
typedef struct tToken
{
tState state; //stav lexemu
char *data; //hodnota lexemu
int row; //radek lexemu
int column; //sloupec lexemu
}tToken;
tToken token;
...
void *gcMalloc(int dataSize){
...
void *AllocatedData = (void*)malloc(dataSize);
return AllocatedData;
}
...
if(token.data == NULL)
token.data = (char *) gcMalloc( sizeof(char) ); //there is the problem
But the error
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
is still there... Can someone please explain me why ? And how to change it ?