bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#187391: bug found (in libc)


From: GOTO Masanori
Subject: Re: Bug#187391: bug found (in libc)
Date: Mon, 28 Apr 2003 14:53:28 +0900
User-agent: Wanderlust/2.9.9 (Unchained Melody) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryōmae) APEL/10.3 Emacs/21.2 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI)

At Sun, 27 Apr 2003 14:28:54 -0400 (EDT),
Roland McGrath wrote:
> > let me rephrase the problem. the following code:
> > 
> >     #include <sys/socket.h>
> >     #include <sys/un.h>
> >     main ()
> >     {
> >       sockaddr_un test = { AF_LOCAL, "" };
> >     }
> 
> This code is wrong, i.e. not portable or POSIX-compliant.  You cannot use
> normal initializers for a structure that is part of a standard API, because
> in no such structure does the API specify the order of members, and in most
> such structures it's permissible to have additional members.  You can use
> an initializer if you use C99 labelled syntax, but what the code ought to
> do is not use an initializer.
> 
> > and the bug can be fixed without changing the definition, by just
> > applying this:
> 
> You seem to be confused.  That patch changes the definition of struct
> sockaddr_*, and not in a way that is compatible with anything else.

That's right.

BTW, Roland, could you plan to add sun_len into sockaddr_un on Hurd?
It's not senseless modification, I think.

Regards,
-- gotom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]