bug or problem with gcc and include files

David Jansen jansen at strw.leidenuniv.nl
Thu Mar 25 09:49:54 UTC 2004


I have to install a program here at work that compiles fine on SuSe and
on RedHat 9, but not on FC1.
After experimenting with the routines and eliminating everything that is
not necessary to reproduce the bug, this is what it boils down to:
$ cat test1.c
void test1()
{
#include <sys/file.h>
 
return(0);
}
$ gcc -o test1.o -c test1.c
In file included from /usr/include/sys/types.h:219,
                 from /usr/include/bits/fcntl.h:25,
                 from /usr/include/fcntl.h:33,
                 from /usr/include/sys/file.h:25,
                 from test1.c:3:
/usr/include/sys/sysmacros.h: In function `test1':
/usr/include/sys/sysmacros.h:43: error: nested function `gnu_dev_major' declared `extern'
/usr/include/sys/sysmacros.h:49: error: nested function `gnu_dev_minor' declared `extern'
/usr/include/sys/sysmacros.h:55: error: nested function `gnu_dev_makedev' declared `extern'

Now that's easy to fix; if I move the #include out of the function to
the top of the source file, it compiles woithout any problems. Only the
package author didn't accept this "patch", stating that the program is
correct and the bug is in the fedora includes or gcc version.
What is your collective wisdom on this subject?

David Jansen





More information about the fedora-list mailing list