From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7456 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: x86_64 and x32 fail to build Date: Mon, 20 Apr 2015 21:35:25 -0400 Message-ID: <20150421013525.GT6817@brightrain.aerifal.cx> References: <20150420211359.GS6817@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1429580141 9882 80.91.229.3 (21 Apr 2015 01:35:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Apr 2015 01:35:41 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7469-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 21 03:35:40 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YkN6C-0006aB-Cv for gllmg-musl@m.gmane.org; Tue, 21 Apr 2015 03:35:40 +0200 Original-Received: (qmail 7926 invoked by uid 550); 21 Apr 2015 01:35:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7905 invoked from network); 21 Apr 2015 01:35:38 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7456 Archived-At: On Tue, Apr 21, 2015 at 02:56:27AM +0300, Alexander Monakov wrote: > > When building without --enable-warnings, there are many false positives from > > -Wpointer-to-int-cast about x32 __scc(); at least from 4.5 onwards GCC enables > > this warning by default, so perhaps if musl really wants to silence it, it > > should test the corresponding -Wno-... flag outside of x$warnings == xyes > > test? > > Could it be possible that implementation of __scc() can be adjusted to avoid > triggering the warning? I hoped the following would achieve that: > > // Cast X to signed integral type of corresponding size > #define __scc1(X) (__typeof__((X)-(__typeof__(1?(X):0))0)) (X) > #define __scc(X) sizeof(1?(X):0ULL) < 8 ? (unsigned long) __scc1(X) : (long long) __scc1(X) > > .... but unfortunately it doesn't work with -Werror=pointer-arith when type of > X is 'void *'. Indeed, introducing invalid C to make a warning go away is not a nice tradeoff. Rich