mailing list of musl libc
 help / color / mirror / code / Atom feed
* Warnings to be ignored when building musl
@ 2019-03-11 11:16 Dmitry Golovin
  2019-03-11 12:05 ` Szabolcs Nagy
  2019-03-13  0:43 ` Rich Felker
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Golovin @ 2019-03-11 11:16 UTC (permalink / raw)
  To: musl

I'm building musl 1.1.21 with clang and I get a lot of compiler warnings. I wonder if it's safe to ignore some of them?

Here is a list of warnings I got:
-Wbitwise-op-parentheses
-Wdangling-else
-Wignored-attributes
-Wlogical-op-parentheses
-Wparentheses
-Wshift-op-parentheses
-Wstring-plus-int
-Wunknown-pragmas

Which of them should be ignored when building with clang? What are better be fixed?

Regards,
Dmitry


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

* Re: Warnings to be ignored when building musl
  2019-03-11 11:16 Warnings to be ignored when building musl Dmitry Golovin
@ 2019-03-11 12:05 ` Szabolcs Nagy
  2019-03-13  0:43 ` Rich Felker
  1 sibling, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2019-03-11 12:05 UTC (permalink / raw)
  To: musl

* Dmitry Golovin <dima@golovin.in> [2019-03-11 13:16:39 +0200]:
> I'm building musl 1.1.21 with clang and I get a lot of compiler warnings. I wonder if it's safe to ignore some of them?

any parentheses warning should be ignored.

currently you need to learn the c operator
precedence rules to work on musl code.

ignored-attributes and dangling-else may
be relevant.

string-plus-int should be ignored.

> 
> Here is a list of warnings I got:
> -Wbitwise-op-parentheses
> -Wdangling-else
> -Wignored-attributes
> -Wlogical-op-parentheses
> -Wparentheses
> -Wshift-op-parentheses
> -Wstring-plus-int
> -Wunknown-pragmas
> 
> Which of them should be ignored when building with clang? What are better be fixed?
> 
> Regards,
> Dmitry


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

* Re: Warnings to be ignored when building musl
  2019-03-11 11:16 Warnings to be ignored when building musl Dmitry Golovin
  2019-03-11 12:05 ` Szabolcs Nagy
@ 2019-03-13  0:43 ` Rich Felker
  1 sibling, 0 replies; 3+ messages in thread
From: Rich Felker @ 2019-03-13  0:43 UTC (permalink / raw)
  To: musl

On Mon, Mar 11, 2019 at 01:16:39PM +0200, Dmitry Golovin wrote:
> I'm building musl 1.1.21 with clang and I get a lot of compiler
> warnings. I wonder if it's safe to ignore some of them?
> 
> Here is a list of warnings I got:
> -Wbitwise-op-parentheses
> -Wdangling-else
> -Wignored-attributes
> -Wlogical-op-parentheses
> -Wparentheses
> -Wshift-op-parentheses
> -Wstring-plus-int

All of these except -Wignored-attributes are style warnings we don't
attempt to follow. Whatever is triggering -Wignored-attributes in
clang might be an issue we should address.

> -Wunknown-pragmas

This one is definitely bad because gcc and clang fail to implement
some pragmas the standard requires to exist -- ones for floating point
environment stuff. With the right CFLAGS, the default behavior mostly
matches what the pragmas are trying to get and everything is okay, but
for source-level correctness they need to be there.

> Which of them should be ignored when building with clang? What are
> better be fixed?

I'd like to make this more clearly documented and automatically setup
by configure. The intended warnings are what you get with gcc and
passing --enable-warnings to configure, which uses -Wall then disables
ones that are noise, arbitrary style rules, etc. I think it should be
switched around to avoid -Wall, instead starting with -w for non-gcc
compilers and blank for gcc (since -w overrides later -W on gcc), then
explicitly adding the warning options we want to check against. Right
now, the only way to get that list is reading the gcc documentation
for -Wall and subtracting off the -Wno-*'s that musl's configure adds.

Rich


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

end of thread, other threads:[~2019-03-13  0:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 11:16 Warnings to be ignored when building musl Dmitry Golovin
2019-03-11 12:05 ` Szabolcs Nagy
2019-03-13  0:43 ` Rich Felker

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