[PATCH] Minor style correction in util_sock - Samba

This is a discussion on [PATCH] Minor style correction in util_sock - Samba ; > On Fri, Jul 04, 2008 at 01:31:34AM -0700, Zachary Loafman wrote: > > That said, I still would've coded it as sa->sin_family = AF_INET. > > Flip-flopping types is fugly. > > Agreed. Feel free to submit a patch ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH] Minor style correction in util_sock

  1. [PATCH] Minor style correction in util_sock

    > On Fri, Jul 04, 2008 at 01:31:34AM -0700, Zachary Loafman wrote:
    > > That said, I still would've coded it as sa->sin_family = AF_INET.
    > > Flip-flopping types is fugly.

    >
    > Agreed. Feel free to submit a patch :-)


    Attached. Now about those 4 I sent last week..

    > On the whole issue, if I get
    > http://mail-index.netbsd.org/tech-ke...8/11/0001.html
    > right, going via a char * or a void * avoids the whole
    > aliasing issue?


    That article seems to have a good summary, yeah. Going through char *
    fixes it, but honestly, I prefer the approach of breaking out the
    aliased types into small (theoretically inline-able) functions. The
    in_addr_to_sockaddr_storage function is actually a great example of how
    to avoid aliasing issues - it handles the messy aliasing of the
    sockaddr_storage struct so that the caller doesn't get bitten. Many
    times you can write little wrappers like that.

    ....Zach



  2. Re: [PATCH] Minor style correction in util_sock

    On Mon, Jul 07, 2008 at 07:43:19PM -0700, Zachary Loafman wrote:
    > This time with an actual patch attached.


    Pushed, thanks.

    Jeremy.


+ Reply to Thread