From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13818 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Nick Bray Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] eliminate strict parentheses warnings for byteswaps Date: Tue, 19 Feb 2019 14:54:46 -0800 Message-ID: References: <20190215023851.GA23599@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="119607"; mail-complaints-to="usenet@blaine.gmane.org" To: musl@lists.openwall.com Original-X-From: musl-return-13834-gllmg-musl=m.gmane.org@lists.openwall.com Tue Feb 19 23:55:15 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 1gwEIE-000V0p-Lz for gllmg-musl@m.gmane.org; Tue, 19 Feb 2019 23:55:14 +0100 Original-Received: (qmail 21590 invoked by uid 550); 19 Feb 2019 22:55:12 -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 21571 invoked from network); 19 Feb 2019 22:55:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=V3NnVal5e0B9JPpjlp2NsYd6M+rE6EVyf/ch5Xc9AZE=; b=OLYsG7uV6kRWi+s9tdXqRbge4rpU2IQD4a+XsEqVX2xrJ8W+B5YfzAX5lr2OI4/18s x8EE5h3h3g9+5GWS6TNlM06XmNVy7h4LHWMy09EQN6BgFTsToep06TYXSUiGMZ0Qu0/s b3X8k8hQi1yVZ2DAzwQitur9hA+/hrkQQtDedJxl/oin//G6TZnU7ZK2q7+/d2AkNEFw mA3I53fl/Mx+eGjb4m5H8tuSXN5JxxhIoYz5Fa44Xw+8T5sXdgqSwBQwAhAO0WvBAXXD MVGxgPOhnLakQXUhmN8LNtxIQ+eTCd6fbBoDzQl0aaESYNkaQ5laRcFOocFNsO+hoV0S eKIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=V3NnVal5e0B9JPpjlp2NsYd6M+rE6EVyf/ch5Xc9AZE=; b=NKx7Mj+eK+mceaF4gB1oEzAq8pTPkpLLNJ63iHEYCjBCkEQ5ffZRW2G39ZjuWcoay0 /djGFxYECPg0/GBKgakgnQpULMQ4uu7WicsJJ5RbuK1wXkYFFtNiOEtxV1aU3bgtGinm IEQYe6P48e3QbWCgnsnLYRtYCPTQlUHdu9Z6SQpuyhMDeBXenvqsfvKdm3XP2CSH6F7z 1IkZVo4mKsqse8nV3ema3Si7NdHVOGanUSeay+4cjMhO84XepDY+o62zodgYz+2IPx3z D/nkLLOwaB+dBsYwrnJNCmFHpU0Eg7XNcQt8f6k+Y2vr9eN5a5T4mB8FR8RyG5uOEDR8 qnRA== X-Gm-Message-State: AHQUAuZbGB4RCzY/wrU06so8n+kidtp+RowFpIckrf688uoost70viQX TnKVFQJeS6r42nIeVwV54zle2O51GX1wliFUt6WeUa/qwl8= X-Google-Smtp-Source: AHgI3IZ3dHsgwMXxpUEs4134ICvKQnaKkXZf5aW159MgGFiAwgcULVqZYuf3aHucq2yvkexKt9M2NUVBZVg5RQcnwi4= X-Received: by 2002:a05:6638:22c:: with SMTP id f12mr4635861jaq.32.1550616898711; Tue, 19 Feb 2019 14:54:58 -0800 (PST) In-Reply-To: <20190215023851.GA23599@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:13818 Archived-At: On Thu, Feb 14, 2019 at 6:39 PM Rich Felker wrote: > > 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. It looks like -isystem could work for my use case. All things equal, I'd prefer to have stricter compiler settings when modifying Musl and also prefer not to rely on the esoteric details of -isystem. But I'd prefer -isystem to adding local patches. I leave the question of future direction to y'all. > 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