If I use malloc in my code:
int *x = malloc(sizeof(int));
I get this warning from gcc:
new.c:7: w
You need to add:
#include
This file includes the declaration for the built-in function malloc. If you don't do that, the compiler thinks you want to define your own function named malloc and it warns you because:
int, which isn't compatible with the built-in malloc, which takes a size_t and returns a void*).