From owner-svn-src-head@freebsd.org Wed May 18 23:43:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A179AB41E08; Wed, 18 May 2016 23:43:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6505C1FA2; Wed, 18 May 2016 23:43:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 289B23C526F; Thu, 19 May 2016 09:43:55 +1000 (AEST) Date: Thu, 19 May 2016 09:43:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300167 - in head: contrib/bsnmp/snmpd usr.sbin/bsnmpd/bsnmpd In-Reply-To: <1463609665.1180.301.camel@freebsd.org> Message-ID: <20160519092734.U1798@besplex.bde.org> References: <201605182202.u4IM2JF7047307@repo.freebsd.org> <1463609665.1180.301.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=j5YYvsyAr7R3ibaSyqUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 23:43:57 -0000 On Wed, 18 May 2016, Ian Lepore wrote: > On Wed, 2016-05-18 at 22:02 +0000, Gleb Smirnoff wrote: >> Log: >> Revert r299830, it has couple of fatal errors. >> >> The CMSG_ family of macros take care of alignment, so we don't need >> r299830 >> at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile. The breaks detection of cast-align bugs elsewhere in the program. > So all of this was about a "cast increases required alignment" kind of > warning for a macro that takes care of alignment? Wouldn't the proper > fix then be to change CMSG_DATA() so that its internal cast is void* > instead of unsigned char* (he asked, knowing Bruce would come along > soon and point out why that's a dumb question)? I don't know much about CMSG*, so I wouldn't have if you didn't ask :-). Changing its type might expose bugs. Kernel code mostly casts it so would get the same cast-align error if that were enabled in the kernel. netinet6 passes it to a function without an explicit cast. The function does an implicit conversion to a struct pointer and there should be a different warning for that. char * and u_char * are required to be binary compatible with void *, but it is bad style to depend on that. So void * works better in all cases in the kernel. LINUX_CMSG_DATA() already returns void *. Bruce