Either calloc or dnode_create doesn't have a prototype in view when you try to use it.
That means it assumes an int return type, hence your warning message.
To ensure a prototype for calloc is in view, include the stdlib.h header file.
If it's the dnode_create, you have to do it yourself, by either:
- defining the function before you use it (in a given source file); or
- declaring a prototype before you use it.
Expanding on that, both of these will work, assuming they're sequenced this way in a single translation unit (simplistically, source file). First:
struct dnode *dnode_create (void) { // declare & define
return calloc(1, sizeof(struct dnode));
}
:
{ // inside some function
struct dnode *newnode = dnode_create(); // use
}
Or:
struct dnode *dnode_create (void); // declare
:
{ // inside some function
struct dnode *newnode = dnode_create(); // use
}
:
struct dnode *dnode_create (void) { // define
return calloc(1, sizeof(struct dnode));
}
You'll notice also that I've used void in the function declaration in both cases above. There's a subtle difference between that (no parameters) and the empty parameter list (an indeterminate number of parameters). You should use the former if you really want a parameter-less function.