recover.c should include sys/sysmacros.h for makedev()
Status: Abandoned
Brought to you by:
robi6
the makedev() function is defined in sys/sysmacros.h, so recover.c should include it to avoid missing prototypes. otherwise you can get build failures like:
recover.c: In function ‘recover_file’: recover.c:478:35: warning: implicit declaration of function ‘makedev’ [-Wimplicit-function-declaration] retval = mknod(helpname, type ,makedev(major, minor)); ext4magic-recover.o: In function `recover_file': src/recover.c:478: undefined reference to `makedev'
Unfortunately I can not reproduce the warning:
warning: implicit declaration of function 'makedev'
Can you tell me on which system/version this warning is reproducible.
On all systems I've tested, sys/sysmacros.h automatically involved over <stdlib.h>
stdlib.h #include <sys types.h="">
sys/types.h #include <sys sysmacros.h="">
Robi
the implicit includes of sys/sysmacros.h by other headers is being fixed in C libs like glibc. it's not been released yet. so the error i posted will happen in the future, so better to fix it now ;).
okay, I have found the cause.
deprecated sys/sysmacros.h inclusion from sys/types.h
We will modify this in recover.c
thank you
Robi
This seems to be easy to fix by adding
#include <sys/sysmacros.h>
in recover.c