Date: Tue, 12 Mar 2019 20:43:05 -0400 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: Warnings to be ignored when building 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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.