invalid use of undefined type `struct fd_set'

howarth@nitro.med.uc.edu howarth@nitro.med.uc.edu
Sun Oct 18 16:27:00 GMT 1998


      In trying to build the molecular model viewer rasmol, I believe I have
found a flaw in egcs 1.1b. When I try to compile the following test case...

----------------------------
#include <sys/select.h>

int socket;
static struct fd_set OrigWaitSet;
main() {
FD_SET(socket,&OrigWaitSet);
}                       
----------------------------

....I get the compiler errors...
mybug.c: In function `main':
mybug.c:6: invalid use of undefined type `struct fd_set'
mybug.c: At top level:
mybug.c:4: storage size of `OrigWaitSet' isn't known  

This is on linuxppc running glibc 2.0.98 and linux 2.1.125. It seems to me that
the compiler is unable to distinguish the lower case declaration of fd_set as a
struct from the uppercase declaration of FD_SET as a macro. Below are the
snippets from my sys/select.h with the declarations...

/* Representation of a set of file descriptors.  */
typedef __fd_set fd_set;   

/* Access macros for `fd_set'.  */
#define FD_SET(fd, fdsetp)      __FD_SET ((fd), (fdsetp))

Is there a patch in the egcs main tree for this already?
                 Jack



More information about the Gcc-bugs mailing list