From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10475 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] fix type for ifc_ifcu.ifcu_buf field of struct ifconf Date: Fri, 16 Sep 2016 10:57:01 -0400 Message-ID: <20160916145701.GL15995@brightrain.aerifal.cx> References: <20160915152731.4897-1-dsabogalcc@gmail.com> <20160915152731.4897-2-dsabogalcc@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1474037847 20885 195.159.176.226 (16 Sep 2016 14:57:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Sep 2016 14:57:27 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10488-gllmg-musl=m.gmane.org@lists.openwall.com Fri Sep 16 16:57:22 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bkuZo-0004Gu-Lw for gllmg-musl@m.gmane.org; Fri, 16 Sep 2016 16:57:16 +0200 Original-Received: (qmail 27943 invoked by uid 550); 16 Sep 2016 14:57:15 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 27919 invoked from network); 16 Sep 2016 14:57:15 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10475 Archived-At: 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 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