At Thu, 3 Apr 2003 03:42:11 +0200, Robert Millan wrote: > the following code seems to be compliant with the Glibc documentation > referred to sockaddr_un, as it provides a char* as the second component > of the struct: > > #include <sys/socket.h> > #include <sys/un.h> > main () > { > sockaddr_un test = { AF_LOCAL, "" }; > } > > however, when built with g++ (and not with gcc) on GNU/Hurd, it reports > mismatch errors: > > test.c: In function `int main()': > test.c:6: invalid conversion from `const char*' to `unsigned char' d > > which is strange that it expects a char when both the documentation > and <sys/un.h> agree that it should be a char*. > > the code in question compiles fine on GNU/Linux.
SUSv3 describes sockaddr_un has at least sun_family and sun_path. The definition of 4.4BSD adds sun_len. Hurd uses the generic definition, and other use the 4.4BSD's. Historically, BSD (4.2?) does not have sun_len member in struct sockaddr_un. Nowadays BSD (after 4.3?) has sockaddr_un.sun_len. sockaddr_un can be variable length, so I think your program style should be avoided. I think it's appropriate to use the substitution like test.sun_family=AF_LOCAL, or so. I don't think it's bug. I would like to close your report, ok? Regards, -- gotom _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd