|
Message-ID: <20160916145701.GL15995@brightrain.aerifal.cx> Date: Fri, 16 Sep 2016 10:57:01 -0400 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: [PATCH] fix type for ifc_ifcu.ifcu_buf field of struct ifconf On Fri, Sep 16, 2016 at 11:12:14AM +0300, Alexander Monakov wrote: > On Thu, 15 Sep 2016, Daniel Sabogal wrote: > > On Thu, Sep 15, 2016 at 4:25 PM, Alexander Monakov <amonakov@...ras.ru> wrote: > > > Declaration of 'ifru_data' in that header has the same issue. > > > > I originally considered changing this one but had left it out since > > linux disagree on the type (void *). > > Ah. From looking at pre-git Linux history, it appears that it had > 'char *', but then it was changed to 'void *' in June 2004 by commit > '[PATCH] sparse: ->ifr_data annotation' by Al Viro, causing a divergence > with the Glibc interface. > > FreeBSD also has 'char *' (caddr_t) there, and netdevice(7) manpage documents > that the Linux interface has 'char *' as well. Thus, the kernel uapi header is > the odd one out. > > Please wait for further feedback from Rich. I'd lean towards char* because if applications perform arithmetic on it expecting it to be char*, void* yields UB. The kernel folks love their void* arithmetic... Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.