From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12345 Path: news.gmane.org!.POSTED!not-for-mail From: Patrick Cheng Newsgroups: gmane.linux.lib.musl.general Subject: Re: [Patch] reduced warnings reported by clang Date: Tue, 09 Jan 2018 17:49:15 +0000 Message-ID: References: <20180109170149.p53whn624pzkac7m@voyager> <20180109170746.GV1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11472d2623c9ff05625b89de" X-Trace: blaine.gmane.org 1515520065 3400 195.159.176.226 (9 Jan 2018 17:47:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 Jan 2018 17:47:45 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-12361-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jan 09 18:47:41 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 1eYxzw-0000VC-Um for gllmg-musl@m.gmane.org; Tue, 09 Jan 2018 18:47:41 +0100 Original-Received: (qmail 4079 invoked by uid 550); 9 Jan 2018 17:49:38 -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 4032 invoked from network); 9 Jan 2018 17:49:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=3cMjbi6UXHxdRenm0sImtHI1cxDFevvvWNoRwPtb6FU=; b=WVJd8XwWNk4x1SkfhrU5EaouLXziMzKOS81URcecvxV+ZjazlVzHiXpvYCCmlxiczZ H9E6OSeJ0D3lTXIpHf7UmECWQL60ZM88lMdgQQGldcimgOrAvKg27hXXJSAcOwUZkV+P 40BGoCClfGRwsAaKlo/3RJJoFnXdx3Zn6Ipfmfrlo2yKsLgCA9NIUWLi6oPFR6m4+89L +E2zFJC9TvERt500Wtvm4+iUA7aOnOOdXbuZnpzAxd7dbzrR9ygW6XEybfhJxwm298a/ KKPM34FEsu5AhQ5tQk64vG3uHy4TKsC7Aw16asfH9SQvXMiSj6HnEa5UoKMQtGZdV5Qm vShg== 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=3cMjbi6UXHxdRenm0sImtHI1cxDFevvvWNoRwPtb6FU=; b=kpklsSwaM/dVlVJIljqQQ8Y2HfFirAe3veaXxpY78amQjxmC5p9KMKoyN4vLxtB2d+ IP08PsHYGCog0K7lMwV+HR7OSxaBAuubGTHyP36ngp49TnOmuNi9yTXxSoj41u1T9XUB ePwufRWp0bc70NhXpC8duoi9kiniLKGNuEibVCUaKFTs0JAkdUiE4Xz4NP3AV2/5iK+5 sPudQXOr8TxxZCDxqK+xyaWPNYhIcllgV8Rb6iCu62bBoQEjJvYE10fgaU9Scpzje0Mm bljQAXfLDwx84wWxy1qiYqSxO4DUAI4USeyZM5ngUwVcMjBnlDbsA7I3hNQfZX5EV7Y+ ujQw== X-Gm-Message-State: AKwxyted6hnzVBabmCB6DnzMKHnUIips/iqPcOb9331ofYPz2dUdJo8i LTY3DBswIHjaFm4hC3FxKGsKapbV5Zgy7YNDPks= X-Google-Smtp-Source: ACJfBosxwMfnMrw6BWQRkqd+ENW/iUJ0eA1P/iHyI3UkA0Ce8UhpaotTEb8hqfvr/V512ysBpOlsaVI7NiO5IKf2+Fs= X-Received: by 10.25.206.77 with SMTP id e74mr7139541lfg.142.1515520165920; Tue, 09 Jan 2018 09:49:25 -0800 (PST) In-Reply-To: <20180109170746.GV1627@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:12345 Archived-At: --001a11472d2623c9ff05625b89de Content-Type: text/plain; charset="UTF-8" Thank you for the pointers. That helps. Found out it was my fault. When building musl, I set the --prefix=/usr So in the project, althought I did pass a --sysroot, I also ended up passing -I.../usr (where musl lives). Once I sorted those out, the warnings disappears. Thanks again. On Tue, Jan 9, 2018 at 9:08 AM Rich Felker wrote: > 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 > --001a11472d2623c9ff05625b89de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you for the pointers. That helps.
Found out it was my fault.=C2=A0
When building musl, = I set the --prefix=3D/usr

So in the project, a= lthought I did pass a --sysroot, I also ended up passing -I.../usr (where m= usl lives).

Once I sorted those out, the warnings = disappears.

Thanks again.



On Tue, Ja= n 9, 2018 at 9:08 AM Rich Felker <dal= ias@libc.org> wrote:
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 th= e warning
> > level/toggle on the project that I was compiling, but Musl header= s 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 c= onst 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<= br> 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
--001a11472d2623c9ff05625b89de--