Description of problem: Wanted to play with btrfs: http://oss.oracle.com/~mason/btrfs/ on a rawhide box, however the btrfsck tools will not build. After some testing it seems like it will build on Fedora Core 6, but not on Fedora 7 or rawhide. The error I get is: gcc -g -Wall -fno-strict-aliasing -Werror -c btrfsck.c In file included from /usr/include/fcntl.h:38, from btrfsck.c:23: /usr/include/sys/stat.h:370: error: array type has incomplete element type As Fedora 7 and rawhide has newer glibc, the problem might be here. Version-Release number of selected component (if applicable): glibc-2.6-3 gcc-4.1.2-12 How reproducible: Download btrfs-progs and try to build on Fedora 7 or rawhide. http://oss.oracle.com/~mason/btrfs/btrfs-progs-0.2.tar.bz2
btrfsck.c is just buggy: #define _XOPEN_SOURCE 500 #include <stdio.h> #include <stdlib.h> #define __USE_GNU #include <fcntl.h> __USE_GNU macro is glibc implementation detail, no program must ever touch it. See info libc 'Feature Test Macros' The feature test macros (_*_SOURCE) must be defined before including any header. In this case SUSv3 namespace is not enough, as they want the readahead prototype. But #define __USE_GNU is a wrong way to choose it, the right way is to #define _GNU_SOURCE 1 above the first included header (either instead of _XOPEN_SOURCE 500 or together with it).
Thanks Jakub!