kconfig_parser.c:5: warning: ‘struct FTW’ declared inside parameter list
kconfig_parser.c:5: warning: its scope is only this definition or declaration, which is probably not what you want
kconfig_parser.c: In function ‘wrapper’:
kconfig_parser.c:6: error: dereferencing pointer to incomplete type

I've checked the definition of the struct and the prototype of the callback, and some examples, it should be fine... What am I doing wrong ? (I've removed almost everything of my code to clear it)...

Actually, I linked to the SUSv2 specification for how nftw is supposed to work (which I have since updated to the SUSv3 link). On a SUSv2 or SUSv3 compliant system, you shouldn't need that #define, but it looks like you may need it on Linux.
–
Brian CampbellApr 23 '09 at 16:16

Brian: In fact, you are right. At the bottom of the new manual page you can read: "Issue 5: Moved from X/OPEN UNIX extension to BASE.". So, it was originally an X/OPEN extension, then moved to base. For some reason, Linux is still using SUSv1 of this API.
–
JulianoApr 23 '09 at 16:37

2

Just a note: the #define needs to be before the inclusion of the first header, even unrelated ones.
–
TinyTimZamboniNov 14 '11 at 16:23

Hmm. Your code works for me. Check your include paths, maybe? Though this is a system header, so it should be pretty hard to miss this. Or were you accidentally compiling a version that didn't have the #include <ftw.h> line?

edit: The test above was done on Mac OS X. In a (now deleted) comment the OP mentioned he was on Debian, for which the man page mentions that #define _XOPEN_SOURCE 500 is necessary, as Juliano points out.