From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12339 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [Patch] reduced warnings reported by clang Date: Tue, 9 Jan 2018 12:07:46 -0500 Message-ID: <20180109170746.GV1627@brightrain.aerifal.cx> References: <20180109170149.p53whn624pzkac7m@voyager> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1515517576 26113 195.159.176.226 (9 Jan 2018 17:06:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 Jan 2018 17:06:16 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12355-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jan 09 18:06:12 2018 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.84_2) (envelope-from ) id 1eYxLi-0006Iu-JD for gllmg-musl@m.gmane.org; Tue, 09 Jan 2018 18:06:06 +0100 Original-Received: (qmail 26471 invoked by uid 550); 9 Jan 2018 17:08:02 -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 26318 invoked from network); 9 Jan 2018 17:07:59 -0000 Content-Disposition: inline In-Reply-To: <20180109170149.p53whn624pzkac7m@voyager> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12339 Archived-At: On Tue, Jan 09, 2018 at 06:01:49PM +0100, Markus Wichmann wrote: > On Tue, Jan 09, 2018 at 04:48:02PM +0000, Patrick Cheng wrote: > > Hello, > > > > Not sure if it's the version of clang that I was using, or the warning > > level/toggle on the project that I was compiling, but Musl headers were > > causing a number of warnings. > > > > Added extra parenthesis, so it's more explicit the precedence of | vs & > > > > Added 'const' to the typecasting. Clang didn't like const casting. > > > > Didn't we have this topic already? If clang reports warnings from system > headers, it is broken. Either because it is not told those headers are > from the system (did you use -I instead of -isystem?) or because clang > is broken fundamentally. The latter appears to be unlikely, but I've > seen horses puke before. Yes, musl policy is not to let compiler warning whims dictate the way code or headers are written, on the assumption that musl itself is built with the warning options it's intended to be used with, and that compilers do not generate warnings for system headers. As you noted, usually when this topic comes up it means the user has not installed musl correctly and is trying to manually -I it rather than using a musl-targeting toolchain or the provided wrapper scripts. So it tends to be a helpful warning that something else is wrong in the user's setup. Rich