mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: endian.h warnings
Date: Tue, 9 Jul 2013 22:25:28 -0400	[thread overview]
Message-ID: <20130710022528.GV29800@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAPfzE3ZSbwgBi=YLaqJ0qvYYN8Hp9qFiQSx=QGA8MYZqJyYnQA@mail.gmail.com>

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


  reply	other threads:[~2013-07-10  2:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10  2:21 Andre Renaud
2013-07-10  2:25 ` Rich Felker [this message]
2013-07-10  3:11   ` Andre Renaud
2013-07-10  2:29 ` Nathan McSween
2013-07-10  8:15   ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130710022528.GV29800@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).