mailing list of musl libc
 help / color / mirror / code / Atom feed
* endian.h warnings
@ 2013-07-10  2:21 Andre Renaud
  2013-07-10  2:25 ` Rich Felker
  2013-07-10  2:29 ` Nathan McSween
  0 siblings, 2 replies; 5+ messages in thread
From: Andre Renaud @ 2013-07-10  2:21 UTC (permalink / raw)
  To: musl

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?

Regards,
Andre


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: endian.h warnings
  2013-07-10  2:21 endian.h warnings Andre Renaud
@ 2013-07-10  2:25 ` Rich Felker
  2013-07-10  3:11   ` Andre Renaud
  2013-07-10  2:29 ` Nathan McSween
  1 sibling, 1 reply; 5+ messages in thread
From: Rich Felker @ 2013-07-10  2:25 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: endian.h warnings
  2013-07-10  2:21 endian.h warnings Andre Renaud
  2013-07-10  2:25 ` Rich Felker
@ 2013-07-10  2:29 ` Nathan McSween
  2013-07-10  8:15   ` Szabolcs Nagy
  1 sibling, 1 reply; 5+ messages in thread
From: Nathan McSween @ 2013-07-10  2:29 UTC (permalink / raw)
  To: musl

On Tuesday, July 09, 2013 7:21:58 PM, 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?
>
> Regards,
> Andres
Try with -Wall -Wextra -Wpedantic. GCC will spam warnings for nearly 
anything, struct padding warnings are extremely annoying. Somewhat 
(maybe?) concerning warnings are signed / unsigned comparisons in math/*



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: endian.h warnings
  2013-07-10  2:25 ` Rich Felker
@ 2013-07-10  3:11   ` Andre Renaud
  0 siblings, 0 replies; 5+ messages in thread
From: Andre Renaud @ 2013-07-10  3:11 UTC (permalink / raw)
  To: musl

Hi Rich,
> 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.

You're right, this was caused because I wasn't correctly using the
musl-gcc wrapper script, so gcc wasn't aware that they were system
includes.

Regards,
Andre


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: endian.h warnings
  2013-07-10  2:29 ` Nathan McSween
@ 2013-07-10  8:15   ` Szabolcs Nagy
  0 siblings, 0 replies; 5+ messages in thread
From: Szabolcs Nagy @ 2013-07-10  8:15 UTC (permalink / raw)
  To: musl

* Nathan McSween <nwmcsween@gmail.com> [2013-07-09 19:29:12 -0700]:
> anything, struct padding warnings are extremely annoying. Somewhat
> (maybe?) concerning warnings are signed / unsigned comparisons in
> math/*

signed anything is concerning in math

(int arithmetics is used for bit representation manipulation
which should not be done signed, but this is a legacy from
fdlibm that will slowly get fixed)

i don't see signed comparision warnings with gcc,
i see a warning about the long double struct on x86
which is planned to be fixed but i wanted to wait until
i get around doing a larger long double code restructuring


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-10  8:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10  2:21 endian.h warnings Andre Renaud
2013-07-10  2:25 ` Rich Felker
2013-07-10  3:11   ` Andre Renaud
2013-07-10  2:29 ` Nathan McSween
2013-07-10  8:15   ` Szabolcs Nagy

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).