From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3596 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: endian.h warnings Date: Tue, 9 Jul 2013 22:25:28 -0400 Message-ID: <20130710022528.GV29800@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1373423144 629 80.91.229.3 (10 Jul 2013 02:25:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jul 2013 02:25:44 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3600-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 10 04:25:42 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Uwk69-0004F8-Mq for gllmg-musl@plane.gmane.org; Wed, 10 Jul 2013 04:25:41 +0200 Original-Received: (qmail 21629 invoked by uid 550); 10 Jul 2013 02:25:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21621 invoked from network); 10 Jul 2013 02:25:40 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3596 Archived-At: On Wed, Jul 10, 2013 at 02:21:58PM +1200, Andre Renaud wrote: > Hi, > When using musl with -Wparentheses enabled, I get the following warnings: > .../include/endian.h: In function '__bswap32': > .../include/endian.h:32:2: warning: suggest parentheses around > arithmetic in operand of '|' [-Wparentheses] > .../include/endian.h:32:2: warning: suggest parentheses around > arithmetic in operand of '|' [-Wparentheses] > .../include/endian.h: In function '__bswap64': > .../include/endian.h:37:2: warning: suggest parentheses around '+' > inside '<<' [-Wparentheses] > > I appreciate that these aren't bugs, and are just gcc being over > enthusiastic in it's warnings (which I've asked it to be on the > command line), however would it be worth sticking some parentheses > into the code simply to avoid this kind of noise being visible for > users? I really don't understand why gcc is generating warnings for these; I thought it automatically suppressed warnings for system include directories, and even macro expansion text generated from macros defined in these headers. If that suppression is not working correctly, maybe we should work around these warnings. I agree it's problematic for users to get spammed with irrelevant warnings that decrease the signal to noise ratio of the compiler's warning generation. Rich