clang -O2 -Wall -Wextra -Werror=implicit-function-declaration dirent/posix_getdents.c -o dirent/posix_getdents -D_GNU_SOURCE -D_BSD_SOURCE -D_ALL_SOURCE -D_DEFAULT_SOURCE -lm -lintl dirent/posix_getdents.c:20:16: error: invalid application of 'sizeof' to an incomplete type 'struct posix_dent' size_t size = sizeof(struct posix_dent) + name_max + 1; ^ ~~~~~~~~~~~~~~~~~~~ dirent/posix_getdents.c:20:30: note: forward declaration of 'struct posix_dent' size_t size = sizeof(struct posix_dent) + name_max + 1; ^ dirent/posix_getdents.c:26:24: error: implicit declaration of function 'posix_getdents' is invalid in C99 [-Werror,-Wimplicit-function-declaration] while ( 0 < (amount = posix_getdents(fd, buffer, size, 0)) ) ^ dirent/posix_getdents.c:32:22: error: incomplete definition of type 'struct posix_dent' if ( !strcmp(entry->d_name, "dirent") ) ~~~~~^ dirent/posix_getdents.c:20:30: note: forward declaration of 'struct posix_dent' size_t size = sizeof(struct posix_dent) + name_max + 1; ^ dirent/posix_getdents.c:34:19: error: incomplete definition of type 'struct posix_dent' offset += entry->d_reclen; ~~~~~^ dirent/posix_getdents.c:20:30: note: forward declaration of 'struct posix_dent' size_t size = sizeof(struct posix_dent) + name_max + 1; ^ 4 errors generated.