From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13802 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] eliminate strict parentheses warnings for byteswaps Date: Thu, 14 Feb 2019 21:38:51 -0500 Message-ID: <20190215023851.GA23599@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="231475"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13818-gllmg-musl=m.gmane.org@lists.openwall.com Fri Feb 15 03:39:08 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1guTP8-000y72-Ti for gllmg-musl@m.gmane.org; Fri, 15 Feb 2019 03:39:06 +0100 Original-Received: (qmail 3728 invoked by uid 550); 15 Feb 2019 02:39:04 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3704 invoked from network); 15 Feb 2019 02:39:03 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13802 Archived-At: On Thu, Feb 14, 2019 at 06:27:26PM -0800, Nick Bray wrote: > To give a little more context, I am targeting a small non-Linux OS. > We are not at a point where maintaining our own toolchain make sense. > Instead we are using Android's prebuilt toolchains, providing an > alternate sysroot (empty for now), and treating Musl as a library > built from source. It's a flat playing field and there is no such > thing as system headers or system libraries. We can dial the > strictness down when compiling Musl itself, but header files touch > everything. This isn't the traditional use case, but Musl seems like > a pretty good choice for embedded systems-ish type work when you need > to scale down into a smaller memory footprint. This has come up enough that there's some chance it may be worth revisiting, but I wonder if using -isystem wouldn't solve your problem. The policy aspect here is that coding style in the libc headers should not be governed by a possibly changing/unbounded set of compiler style warnings. But maybe we should look at whether there's some small set of stricter style rules we should adopt for the headers. Also it's worth noting that, in the past when this has come up, it's brought light to incorrect usage by the person raising the issue -- things like using a glibc-targeting toolchain and just adding -I for the musl include dir. Rich > On Thu, Feb 14, 2019 at 5:55 PM A. Wilcox wrote: > > > > On 02/14/19 18:24, Nick Bray wrote: > > > Patch is attached. > > > > > > The change was motivated by including Musl's headers from a project > > > with -Werror -Wall enabled. I believe Fucshia ran into this, too. I > > > couldn't think of a good regression test, in part because warnings are > > > somewhat compiler specific. One possible approach would be to enable > > > -Werror -Wall in the main build, but that runs into issues of which > > > compilers are supported and what the core developers prefer. Another > > > approach would be to only lint the header files - generate a dummy .c > > > file that includes all the header files and compile it with -Werror. > > > This is complicated by the "redirection" header files that warn you > > > should use the canonical version. Which header files should be > > > checked? So for the moment I punted on regression testing. I mention > > > this line of thinking in case anyone has some perspective. > > > > > > This has a strong +1 from me, but changes like this have already been > > rejected at least twice on this list because "compilers shouldn't warn > > about system headers". > > > > Perhaps at attempt #3, they will just accept that this happens regularly > > enough that a few parens is not the end of the world. (It also makes > > more components of musl reusable in other libraries, if desired.) > > > > Best, > > --arw