From owner-freebsd-toolchain@freebsd.org Sun Jul 10 01:19:12 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40963B837BA for ; Sun, 10 Jul 2016 01:19:12 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-153.reflexion.net [208.70.211.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E74291160 for ; Sun, 10 Jul 2016 01:19:11 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 1292 invoked from network); 10 Jul 2016 01:19:10 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 10 Jul 2016 01:19:10 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Sat, 09 Jul 2016 21:19:04 -0400 (EDT) Received: (qmail 4456 invoked from network); 10 Jul 2016 01:19:04 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 10 Jul 2016 01:19:04 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 5D7F11C4394; Sat, 9 Jul 2016 18:18:43 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Bug 210953] 11.0 -r302412 via powerpc64-xtoolchain-gcc fails to build: dev/ahci/ahci.c:288:22: error: unknown conversion type character 'b' in format; too many arguments for format Date: Sat, 9 Jul 2016 18:19:07 -0700 Message-Id: Cc: FreeBSD Toolchain To: FreeBSD PowerPC ML , freebsd-stable@freebsd.org, FreeBSD Current Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2016 01:19:12 -0000 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210953 > > > Bug ID: 210953 > Summary: 11.0 -r302412 via powerpc64-xtoolchain-gcc fails to > build: dev/ahci/ahci.c:288:22: error: unknown > conversion type character 'b' in format; too many > arguments for format > Product: Base System > Version: 11.0-BETA1 > Hardware: ppc > OS: Any > Status: New > Severity: Affects Only Me > Priority: --- > Component: bin > Assignee: > freebsd-bugs at FreeBSD.org > > Reporter: > markmi at dsl-only.net > > > --- all_subdir_ahci --- > /usr/src/sys/modules/ahci/../../dev/ahci/ahci.c: In function 'ahci_attach': > /usr/src/sys/modules/ahci/../../dev/ahci/ahci.c:288:22: error: unknown > conversion type character 'b' in format [-Werror=format=] > device_printf(dev, "quirks=0x%b\n", ctlr->quirks, > ^ > /usr/src/sys/modules/ahci/../../dev/ahci/ahci.c:288:22: error: too many > arguments for format [-Werror=format-extra-args] I omit the other supporting material. === Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sun Jul 10 02:30:03 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1177B854E5 for ; Sun, 10 Jul 2016 02:30:03 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-153.reflexion.net [208.70.211.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F67F198F for ; Sun, 10 Jul 2016 02:30:02 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 18507 invoked from network); 10 Jul 2016 02:30:38 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 10 Jul 2016 02:30:38 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Sat, 09 Jul 2016 22:30:06 -0400 (EDT) Received: (qmail 16186 invoked from network); 10 Jul 2016 02:30:06 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 10 Jul 2016 02:30:06 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 098411C405F; Sat, 9 Jul 2016 19:29:34 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [Bug 210953] 11.0 -r302412 via powerpc64-xtoolchain-gcc fails to build: dev/ahci/ahci.c:288:22: error: unknown conversion type character 'b' in format; too many arguments for format From: Mark Millard In-Reply-To: Date: Sat, 9 Jul 2016 19:29:59 -0700 Cc: FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: References: To: FreeBSD PowerPC ML , freebsd-stable@freebsd.org, FreeBSD Current X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2016 02:30:03 -0000 [Top post of probable "already fixed" status.] It looks like -r320441 on stable/11 reverted a kern.mk change = controlling what formats are (un)available for some compilers. I'm rebuilding things based on -r302457 instead of -r302412 and will = close the defect if things work. =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-Jul-9, at 6:19 PM, Mark Millard wrote: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210953 >=20 >=20 > Bug ID: 210953 > Summary: 11.0 -r302412 via powerpc64-xtoolchain-gcc fails to > build: dev/ahci/ahci.c:288:22: error: unknown > conversion type character 'b' in format; too many > arguments for format > Product: Base System > Version: 11.0-BETA1 > Hardware: ppc > OS: Any > Status: New > Severity: Affects Only Me > Priority: --- > Component: bin > Assignee:=20 > freebsd-bugs at FreeBSD.org >=20 > Reporter:=20 > markmi at dsl-only.net >=20 >=20 > --- all_subdir_ahci --- > /usr/src/sys/modules/ahci/../../dev/ahci/ahci.c: In function = 'ahci_attach': > /usr/src/sys/modules/ahci/../../dev/ahci/ahci.c:288:22: error: unknown > conversion type character 'b' in format [-Werror=3Dformat=3D] > device_printf(dev, "quirks=3D0x%b\n", ctlr->quirks, > ^ > /usr/src/sys/modules/ahci/../../dev/ahci/ahci.c:288:22: error: too = many > arguments for format [-Werror=3Dformat-extra-args] I omit the other supporting material. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sun Jul 10 06:03:23 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB1E1B8308C for ; Sun, 10 Jul 2016 06:03:23 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-154.reflexion.net [208.70.211.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86E6E1656 for ; Sun, 10 Jul 2016 06:03:23 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26590 invoked from network); 10 Jul 2016 06:04:00 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 10 Jul 2016 06:04:00 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Sun, 10 Jul 2016 02:03:27 -0400 (EDT) Received: (qmail 4567 invoked from network); 10 Jul 2016 06:03:26 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 10 Jul 2016 06:03:26 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 6D2D71C43CA; Sat, 9 Jul 2016 23:02:54 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [Bug 210953] 11.0 -r302412 via powerpc64-xtoolchain-gcc fails to build: dev/ahci/ahci.c:288:22: error: unknown conversion type character 'b' in format; too many arguments for format From: Mark Millard In-Reply-To: <8E57EB70-814D-4849-8E56-95A769AA40D3@gmail.com> Date: Sat, 9 Jul 2016 23:03:19 -0700 Cc: freebsd-bugs@FreeBSD.org, FreeBSD PowerPC ML , freebsd-stable@freebsd.org, FreeBSD Current , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: References: <8E57EB70-814D-4849-8E56-95A769AA40D3@gmail.com> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2016 06:03:24 -0000 On 2016-Jul-9, at 8:53 PM, Ngie Cooper wrote: >> On Jul 9, 2016, at 18:52, bugzilla-noreply@freebsd.org wrote: >>=20 >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210953 >>=20 >> Mark Millard changed: >=20 > I accidentally committed this regression to kern.mk. I don't have = bugzilla login right now. Please assign the bug to me and I'll mark it = fixed for the rev I did it in with head and stable/10. >=20 > Thanks! > -Ngie So far as I know I've no control over the Assignee field for any bug via = bugzilla. Someone that has such can do what Ngie requested and assign = 210953 to him. A rebuild based on -r302457 completed fine for the powerpc64-gcc use, = confirming Ngie's note, at least for 11.0-STABLE. I've no stable/10 context and so have not tested there. Otherwise I = might have just classified the report as "Overcome By Events" myself. I have added a comment to 210953 about my rebuild test and Ngie's = material above. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Sun Jul 10 16:39:26 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF6CB84525; Sun, 10 Jul 2016 16:39:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DB271C13; Sun, 10 Jul 2016 16:39:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x234.google.com with SMTP id hu1so14536113pad.3; Sun, 10 Jul 2016 09:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E1+9l8ay1udNeJknuDYDszcFYroISAY/aDDRCjYmBaU=; b=0L1canahkA4B4ROamuVBS/zQkd+AW7WVOArNgC1yH++8srSGvisXFdkLdLNZa0qywy gV6UXH8Dt9XdJuc4CkpeRNLSxpkuyClXARil6SFu7ZKNwHp8poyMruCFFpVLJKwwoAcN G31IRVZwBSRE4lNO4a0YzNZZESFQaVVl8hveUNiliOTC7rJA+hJHEuQcye+rRpzA37J6 w98RHEGlmtY2Gq36A+YzOz+kj21P8Sp7q5kT9NuvMJ/FsoycShEDm/Q3H/Yx+MNy2sXA ldswyA+eHXKV+CSknOUEJTudPeH95/rzsHgm9UttVqo/PbJ8Go0cFYQqfV6laPUIFeHL n0cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E1+9l8ay1udNeJknuDYDszcFYroISAY/aDDRCjYmBaU=; b=gxRWchkP3Rr6wUyWmaUcdOWMO9w3TMVvaQZqBaQbZljz7gyIZOBvc02jTB8pYYbpOj yQIBwdpb/9RZa9B0lcePGvS51Jf2MXZrzGkZiRJhVcKffylhEwrbTNlHsIEACMKaWzrj H+JiQ5d3obXxKkn4GM63KZRJwTiM7lImoYbrQI+3z7n+RBa69P23o0tM3+qq62lZosxX UX4ejW83AILL3jhdg56ejXgBgsODnvyJh91qZooi7TVKPKeJJKbH+aCsJ4kqU3AWX5SY 9iBbaC6Qt2hrAezWmaWHkZ00rd9pMcL8KW08XJ3Pi6YMKAoZQyX61aGC2Me8wpehiKSO pmCw== X-Gm-Message-State: ALyK8tLhy/uWM17oHXO1Njjsi6HharxusXOD5pmrcEfg5dsitIXB9Kx6SIYButCsOOJRtg== X-Received: by 10.67.7.199 with SMTP id de7mr27373442pad.94.1468168765028; Sun, 10 Jul 2016 09:39:25 -0700 (PDT) Received: from [29.138.229.192] ([172.58.40.198]) by smtp.gmail.com with ESMTPSA id 75sm3461394pfy.32.2016.07.10.09.39.23 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Jul 2016 09:39:24 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [Bug 210953] 11.0 -r302412 via powerpc64-xtoolchain-gcc fails to build: dev/ahci/ahci.c:288:22: error: unknown conversion type character 'b' in format; too many arguments for format From: Ngie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: Date: Sun, 10 Jul 2016 09:39:23 -0700 Cc: freebsd-bugs@FreeBSD.org, FreeBSD PowerPC ML , freebsd-stable@freebsd.org, FreeBSD Current , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <0F02EEBB-30B4-40C4-876C-FD099802A77E@gmail.com> References: <8E57EB70-814D-4849-8E56-95A769AA40D3@gmail.com> To: Mark Millard X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2016 16:39:26 -0000 > On Jul 9, 2016, at 23:03, Mark Millard wrote: >=20 > On 2016-Jul-9, at 8:53 PM, Ngie Cooper wrote: >=20 >>> On Jul 9, 2016, at 18:52, bugzilla-noreply@freebsd.org wrote: >>>=20 >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210953 >>>=20 >>> Mark Millard changed: >>=20 >> I accidentally committed this regression to kern.mk. I don't have bugzill= a login right now. Please assign the bug to me and I'll mark it fixed for th= e rev I did it in with head and stable/10. >>=20 >> Thanks! >> -Ngie >=20 > So far as I know I've no control over the Assignee field for any bug via b= ugzilla. Someone that has such can do what Ngie requested and assign 210953 t= o him. >=20 > A rebuild based on -r302457 completed fine for the powerpc64-gcc use, conf= irming Ngie's note, at least for 11.0-STABLE. >=20 > I've no stable/10 context and so have not tested there. Otherwise I might h= ave just classified the report as "Overcome By Events" myself. >=20 > I have added a comment to 210953 about my rebuild test and Ngie's material= above. stable/10 was a typo. I meant stable/11. No worries.. I'll take care of it when I get home soon. Thanks! >=20 > =3D=3D=3D > Mark Millard > markmi at dsl-only.net >=20 From owner-freebsd-toolchain@freebsd.org Mon Jul 11 10:07:44 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5738EB85675 for ; Mon, 11 Jul 2016 10:07:44 +0000 (UTC) (envelope-from no-reply@x57.vip.6pm-coupon.com) Received: from x57.vip.6pm-coupon.com (x57.vip.6pm-coupon.com [104.148.25.57]) by mx1.freebsd.org (Postfix) with ESMTP id 42972164A for ; Mon, 11 Jul 2016 10:07:44 +0000 (UTC) (envelope-from no-reply@x57.vip.6pm-coupon.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=6pm-coupon; d=x57.vip.6pm-coupon.com; h=MIME-Version:From:To:Date:Subject:Content-Type:Content-Transfer-Encoding; i=no-reply@x57.vip.6pm-coupon.com; bh=/89lgkltzZX1R30NYw8SnPGq9zA=; b=oloPf0zVTX+NcwKgDxGQaU1FIakNuFjHN6+tM2CDh0BOn5luGOZFtzAS53qboTjIcTR8ivwR95Sw 39lUYBO6zeX55CHdaVCMGCqZi2Ooop5eqQ0+016y+vvJSm0VSldvWH1J7ADPWygRWksulLSblGrd uyF/nb/Oo772G4Wh6sw= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=6pm-coupon; d=x57.vip.6pm-coupon.com; b=m/3t4di3bTwHoLXshh+WK5yUXbHdbQwNMFHRpbQNWXp+YM8DANEEGLBtxfUogBSBzEcKplch2+QJ jswJLAqAKMiFyM7PWi0KrkIYp9cM3qIoMuvOmZUCaTr/MLqCercUEi5lqjlXDGtiWdKjOqJNHIOX WBBie1m0B9ADMNPGBNE=; From: "Ray.Ban Sunglasses" To: freebsd-toolchain@freebsd.org Date: 11 Jul 2016 17:46:18 +0800 Subject: Important:Get 90% OFF and Free Shipping424 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 10:07:44 -0000 From owner-freebsd-toolchain@freebsd.org Wed Jul 13 08:53:36 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E632B97081 for ; Wed, 13 Jul 2016 08:53:36 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-154.reflexion.net [208.70.211.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4023C1D48 for ; Wed, 13 Jul 2016 08:53:35 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 23122 invoked from network); 13 Jul 2016 08:54:08 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 13 Jul 2016 08:54:08 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Wed, 13 Jul 2016 04:54:18 -0400 (EDT) Received: (qmail 15942 invoked from network); 13 Jul 2016 08:54:18 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 13 Jul 2016 08:54:18 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 3F1AA1C405F; Wed, 13 Jul 2016 01:53:27 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r302601 - in head/sys: arm/include arm64/include [clang 3.8.0: powerpc has odd mix of signed wchar_t and unsigned char] From: Mark Millard In-Reply-To: Date: Wed, 13 Jul 2016 01:53:27 -0700 Cc: svn-src-head@freebsd.org, FreeBSD Current , freebsd-stable@freebsd.org, freebsd-arm , FreeBSD PowerPC ML , Bruce Evans , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <38CF2C28-3BD1-4D09-939F-4DD0C2E8B58F@dsl-only.net> References: <46153340-D2F4-48BD-B738-4792BC25FA3F@dsl-only.net> To: Andrey Chernov X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2016 08:53:36 -0000 [The below does note that TARGET=3Dpowerpc has a mix of signed wchar_t = and unsigned char types and most architectures have both being signed = types.] On 2016-Jul-11, at 8:57 PM, Andrey Chernov wrote: > On 12.07.2016 5:44, Mark Millard wrote: >> My understanding of the criteria for __WCHAR_MIN and __WCHAR_MAX: >>=20 >> A) __WCHAR_MIN and __WCHAR_MAX: same type as the integer promotion of >> ___wchar_t (if that is distinct). >> B) __WCHAR_MIN is the low value for ___wchar_t as an integer type; = not >> necessarily a valid char value >> C) __WCHAR_MAX is the high value for ___wchar_t as an integer type; = not >> necessarily a valid char value >=20 > It seems you are right about "not a valid char value", I'll back this > change out. >=20 >> As far as I know arm FreeBSD uses unsigned character types (of = whatever >> width). >=20 > Probably it should be unsigned for other architectures too, clang does > not generate negative values with L'' literals and locale use = only > positive values too. Looking around: # grep -i wchar sys/*/include/_types.h sys/arm/include/_types.h:typedef unsigned int ___wchar_t; sys/arm/include/_types.h:#define __WCHAR_MIN 0 = /* min value for a wchar_t */ sys/arm/include/_types.h:#define __WCHAR_MAX __UINT_MAX = /* max value for a wchar_t */ sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; sys/arm64/include/_types.h:#define __WCHAR_MIN 0 = /* min value for a wchar_t */ sys/arm64/include/_types.h:#define __WCHAR_MAX __UINT_MAX = /* max value for a wchar_t */ sys/mips/include/_types.h:typedef int ___wchar_t; sys/mips/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ sys/mips/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ sys/powerpc/include/_types.h:typedef int ___wchar_t; sys/powerpc/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ sys/powerpc/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ sys/riscv/include/_types.h:typedef int ___wchar_t; sys/riscv/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ sys/riscv/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ sys/sparc64/include/_types.h:typedef int ___wchar_t; sys/sparc64/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ sys/sparc64/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ sys/x86/include/_types.h:typedef int ___wchar_t; sys/x86/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ sys/x86/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ So only arm and arm64 have unsigned wchar_t types. [NOTE: __CHAR16_TYPE__ and __CHAR32_TYPE__ are always unsigned: in C++11 = terms char16_t is like std::uint_least16_t and char32_t is like = std::uint_least32_t despite being distinct types. So __CHAR16_TYPE__ and = __CHAR32_TYPE__ are ignored below.] The clang 3.8.0 compiler output has an odd mix for TARGET_ARCH=3Dpowerpc = and TARGET_ARCH=3Dpowerpc64 . . . armv6 has unsigned types for both char and __WCHAR_TYPE__. aarch64 has unsigned types for both char and __WCHAR_TYPE__. powerpc has unsigned for char but signed for __WCHAR_TYPE__. powerpc64 has unsigned for char but signed for __WCHAR_TYPE__. amd64 has signed types for both char and __WCHAR_TYPE__. i386 has signed types for both char and __WCHAR_TYPE__. mips has signed types for both char and __WCHAR_TYPE__. sparc64 has signed types for both char and __WCHAR_TYPE__. (riscv is not covered by clang as I understand) The details via compiler #define's. . . # clang --target=3Darmv6-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ . . . #define __CHAR_BIT__ 8 #define __CHAR_UNSIGNED__ 1 . . . #define __WCHAR_MAX__ 4294967295U #define __WCHAR_TYPE__ unsigned int #define __WCHAR_UNSIGNED__ 1 #define __WCHAR_WIDTH__ 32 . . . # clang --target=3Daarch64-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ . . . #define __CHAR_BIT__ 8 #define __CHAR_UNSIGNED__ 1 . . . #define __WCHAR_MAX__ 4294967295U #define __WCHAR_TYPE__ unsigned int #define __WCHAR_UNSIGNED__ 1 #define __WCHAR_WIDTH__ 32 . . . # clang --target=3Dpowerpc-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ . . . #define __CHAR_BIT__ 8 #define __CHAR_UNSIGNED__ 1 . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . (note the lack of __WCHAR_UNSIGNED__) . . . Is powerpc wrong? # clang --target=3Dpowerpc64-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more . . . #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ . . . #define __CHAR_BIT__ 8 #define __CHAR_UNSIGNED__ 1 . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . (note the lack of __WCHAR_UNSIGNED__) . . . Is powerpc64 wrong? # clang --target=3Damd64-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ . . . #define __CHAR_BIT__ 8 . . . (note the lack of __CHAR_UNSIGNED__) . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . (note the lack of __WCHAR_UNSIGNED__) . . . # clang --target=3Di386-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ . . . #define __CHAR_BIT__ 8 . . . (note the lack of __CHAR_UNSIGNED__) . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . (note the lack of __WCHAR_UNSIGNED__) . . . # clang --target=3Dmips-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ . . . #define __CHAR_BIT__ 8 . . . (note the lack of __CHAR_UNSIGNED__) . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . (note the lack of __WCHAR_UNSIGNED__) . . . # clang --target=3Dsparc64-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ . . . #define __CHAR_BIT__ 8 . . . (note the lack of __CHAR_UNSIGNED__) . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . (note the lack of __WCHAR_UNSIGNED__) . . . =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-toolchain@freebsd.org Thu Jul 14 01:00:34 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E5CB97651 for ; Thu, 14 Jul 2016 01:00:34 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC7C613C3 for ; Thu, 14 Jul 2016 01:00:33 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id h129so51225615lfh.1 for ; Wed, 13 Jul 2016 18:00:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=GaZX3Zul7amFxu9OXBSO+o+VbSL2HHuNJ57ZuUh8dXA=; b=UErTpvzWnTFh362M976Y+0BbVxkO4hGgjhCFaMHEVuDpLBS9yixknpXuf6TrsB9amc oaUFgA990Bpip8CF8mJs6qaIUYQlVDTmIypuDDsorTPpXCh4IscfGoiRpRIzfaFyPgZQ sUXSk7AeQZaMlXyem4FIXz3cNHmE77FUs/8cahmRBIU8bWUd6mHTRS8MbaiYZAsaoCbW tnyAiE5sB0ldFQYAI/b8GflxIIq6MebTOMxs6NDElv8Enz41LCaJadLIXdcK9h6SP++Q MSlWoJyis4bt1/VSZ40ovpi59BLaDKi8xeCGoD1YglqiJ9BMfoflQacaFsCqTSw7dAa1 AJHA== X-Gm-Message-State: ALyK8tKdQMw3Wu/IUzEuIJTZ7oWn0fPiSvm2Cz86+bTDh9yEUCIGMEMiF3uyzc6u67qP9Q== X-Received: by 10.25.154.136 with SMTP id c130mr5564967lfe.87.1468458026291; Wed, 13 Jul 2016 18:00:26 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id o10sm2456631lfo.47.2016.07.13.18.00.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 18:00:25 -0700 (PDT) Subject: Re: svn commit: r302601 - in head/sys: arm/include arm64/include [clang 3.8.0: powerpc has odd mix of signed wchar_t and unsigned char] To: Mark Millard References: <46153340-D2F4-48BD-B738-4792BC25FA3F@dsl-only.net> <38CF2C28-3BD1-4D09-939F-4DD0C2E8B58F@dsl-only.net> Cc: svn-src-head@freebsd.org, FreeBSD Current , freebsd-stable@freebsd.org, freebsd-arm , FreeBSD PowerPC ML , Bruce Evans , FreeBSD Toolchain From: Andrey Chernov Message-ID: Date: Thu, 14 Jul 2016 04:00:24 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <38CF2C28-3BD1-4D09-939F-4DD0C2E8B58F@dsl-only.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 01:00:34 -0000 On 13.07.2016 11:53, Mark Millard wrote: > [The below does note that TARGET=powerpc has a mix of signed wchar_t and unsigned char types and most architectures have both being signed types.] POSIX says nothing about wchar_t and char should be the same (un)signed. It is arm ABI docs may say so only. They are different entities differently encoded and cross assigning between wchar_t and char is not recommended. > > On 2016-Jul-11, at 8:57 PM, Andrey Chernov wrote: > >> On 12.07.2016 5:44, Mark Millard wrote: >>> My understanding of the criteria for __WCHAR_MIN and __WCHAR_MAX: >>> >>> A) __WCHAR_MIN and __WCHAR_MAX: same type as the integer promotion of >>> ___wchar_t (if that is distinct). >>> B) __WCHAR_MIN is the low value for ___wchar_t as an integer type; not >>> necessarily a valid char value >>> C) __WCHAR_MAX is the high value for ___wchar_t as an integer type; not >>> necessarily a valid char value >> >> It seems you are right about "not a valid char value", I'll back this >> change out. >> >>> As far as I know arm FreeBSD uses unsigned character types (of whatever >>> width). >> >> Probably it should be unsigned for other architectures too, clang does >> not generate negative values with L'' literals and locale use only >> positive values too. > > Looking around: > > # grep -i wchar sys/*/include/_types.h > sys/arm/include/_types.h:typedef unsigned int ___wchar_t; > sys/arm/include/_types.h:#define __WCHAR_MIN 0 /* min value for a wchar_t */ > sys/arm/include/_types.h:#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ > sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; > sys/arm64/include/_types.h:#define __WCHAR_MIN 0 /* min value for a wchar_t */ > sys/arm64/include/_types.h:#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ > sys/mips/include/_types.h:typedef int ___wchar_t; > sys/mips/include/_types.h:#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ > sys/mips/include/_types.h:#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ > sys/powerpc/include/_types.h:typedef int ___wchar_t; > sys/powerpc/include/_types.h:#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ > sys/powerpc/include/_types.h:#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ > sys/riscv/include/_types.h:typedef int ___wchar_t; > sys/riscv/include/_types.h:#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ > sys/riscv/include/_types.h:#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ > sys/sparc64/include/_types.h:typedef int ___wchar_t; > sys/sparc64/include/_types.h:#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ > sys/sparc64/include/_types.h:#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ > sys/x86/include/_types.h:typedef int ___wchar_t; > sys/x86/include/_types.h:#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ > sys/x86/include/_types.h:#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ > > So only arm and arm64 have unsigned wchar_t types. > > [NOTE: __CHAR16_TYPE__ and __CHAR32_TYPE__ are always unsigned: in C++11 terms char16_t is like std::uint_least16_t and char32_t is like std::uint_least32_t despite being distinct types. So __CHAR16_TYPE__ and __CHAR32_TYPE__ are ignored below.] > > The clang 3.8.0 compiler output has an odd mix for TARGET_ARCH=powerpc and TARGET_ARCH=powerpc64 . . . > > armv6 has unsigned types for both char and __WCHAR_TYPE__. > aarch64 has unsigned types for both char and __WCHAR_TYPE__. > powerpc has unsigned for char but signed for __WCHAR_TYPE__. > powerpc64 has unsigned for char but signed for __WCHAR_TYPE__. > amd64 has signed types for both char and __WCHAR_TYPE__. > i386 has signed types for both char and __WCHAR_TYPE__. > mips has signed types for both char and __WCHAR_TYPE__. > sparc64 has signed types for both char and __WCHAR_TYPE__. > (riscv is not covered by clang as I understand) > > The details via compiler #define's. . . > > # clang --target=armv6-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 4294967295U > #define __WCHAR_TYPE__ unsigned int > #define __WCHAR_UNSIGNED__ 1 > #define __WCHAR_WIDTH__ 32 > . . . > > # clang --target=aarch64-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 4294967295U > #define __WCHAR_TYPE__ unsigned int > #define __WCHAR_UNSIGNED__ 1 > #define __WCHAR_WIDTH__ 32 > . . . > > # clang --target=powerpc-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . > > Is powerpc wrong? > > # clang --target=powerpc64-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . > > Is powerpc64 wrong? > > > # clang --target=amd64-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . > > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . > > # clang --target=i386-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . > > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . > > > # clang --target=mips-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . > > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . > > # clang --target=sparc64-freebsd11 -std=c99 -E -dM - < /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . > > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . > > > > === > Mark Millard > markmi at dsl-only.net > From owner-freebsd-toolchain@freebsd.org Thu Jul 14 06:53:19 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0724CB98403 for ; Thu, 14 Jul 2016 06:53:19 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-154.reflexion.net [208.70.211.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBF451A6E for ; Thu, 14 Jul 2016 06:53:18 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 9795 invoked from network); 14 Jul 2016 06:46:38 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 14 Jul 2016 06:46:38 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Thu, 14 Jul 2016 02:46:42 -0400 (EDT) Received: (qmail 29570 invoked from network); 14 Jul 2016 06:46:42 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 14 Jul 2016 06:46:42 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 3C1BDB1E001; Wed, 13 Jul 2016 23:46:29 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r302601 - in head/sys: arm/include arm64/include [clang 3.8.0: powerpc int instead of 32-bit SYSVR4's long and 64-bit ELF V2 long] From: Mark Millard In-Reply-To: Date: Wed, 13 Jul 2016 23:46:35 -0700 Cc: svn-src-head@freebsd.org, FreeBSD Current , freebsd-stable@freebsd.org, freebsd-arm , FreeBSD PowerPC ML , Bruce Evans , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <3DFF1DC9-2AE6-498A-9FE0-4970E76F8AB5@dsl-only.net> References: <46153340-D2F4-48BD-B738-4792BC25FA3F@dsl-only.net> <38CF2C28-3BD1-4D09-939F-4DD0C2E8B58F@dsl-only.net> To: Andrey Chernov X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 06:53:19 -0000 On 2016-Jul-13, at 6:00 PM, Andrey Chernov wrote: > On 13.07.2016 11:53, Mark Millard wrote: >> [The below does note that TARGET=3Dpowerpc has a mix of signed = wchar_t and unsigned char types and most architectures have both being = signed types.] >=20 > POSIX says nothing about wchar_t and char should be the same = (un)signed. > It is arm ABI docs may say so only. They are different entities > differently encoded and cross assigning between wchar_t and char is = not > recommended. [My "odd" would better have been the longer phrase "unusual for FreeBSD" = for the signed type mismatch point.] C11 (9899:2011[2012]) and C++11 (14882:2011(E)) agree with your POSIX = note: no constraint to have the same signed type status as char. But when I then looked at the "System V Application Binary Interface = PowerpC Processor Supplement" (1995-Sept SunSoft document) that I = believe FreeBSD uses for powerpc (32-bit only: TARGET_ARCH=3Dpowerpc) it = has: typedef long wchar_t; as part of: Figure 6-39 (page labeled 6-38). While agreeing about the signed-type status for wchar_t this does not = agree with FreeBSD 11.0's use of int as the type: sys/powerpc/include/_types.h:typedef int ___wchar_t; sys/powerpc/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ sys/powerpc/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ # clang --target=3Dpowerpc-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . I'm not as sure of which document is official for TARGET_ARCH=3Dpowerpc64 = but using "Power Architecture 64-bit ELF V2 ABI Specification" (Open = POWER ABI for Linux Supplement) as an example of what likely is common = for that context: 5.1.3 Types Defined in Standard header lists: typedef long wchar_t; which again does not agree with FreeBSD 11.0's use of int as the type: # clang --target=3Dpowerpc64-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more . . . #define __WCHAR_MAX__ 2147483647 #define __WCHAR_TYPE__ int #define __WCHAR_WIDTH__ 32 . . . =3D=3D=3D Mark Millard markmi at dsl-only.net >=20 > On 2016-Jul-11, at 8:57 PM, Andrey Chernov = wrote: >=20 >> On 12.07.2016 5:44, Mark Millard wrote: >>> My understanding of the criteria for __WCHAR_MIN and __WCHAR_MAX: >>>=20 >>> A) __WCHAR_MIN and __WCHAR_MAX: same type as the integer promotion = of >>> ___wchar_t (if that is distinct). >>> B) __WCHAR_MIN is the low value for ___wchar_t as an integer type; = not >>> necessarily a valid char value >>> C) __WCHAR_MAX is the high value for ___wchar_t as an integer type; = not >>> necessarily a valid char value >>=20 >> It seems you are right about "not a valid char value", I'll back this >> change out. >>=20 >>> As far as I know arm FreeBSD uses unsigned character types (of = whatever >>> width). >>=20 >> Probably it should be unsigned for other architectures too, clang = does >> not generate negative values with L'' literals and locale use = only >> positive values too. >=20 > Looking around: >=20 > # grep -i wchar sys/*/include/_types.h > sys/arm/include/_types.h:typedef unsigned int ___wchar_t; > sys/arm/include/_types.h:#define __WCHAR_MIN 0 = /* min value for a wchar_t */ > sys/arm/include/_types.h:#define __WCHAR_MAX __UINT_MAX = /* max value for a wchar_t */ > sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; > sys/arm64/include/_types.h:#define __WCHAR_MIN 0 = /* min value for a wchar_t */ > sys/arm64/include/_types.h:#define __WCHAR_MAX __UINT_MAX = /* max value for a wchar_t */ > sys/mips/include/_types.h:typedef int ___wchar_t; > sys/mips/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ > sys/mips/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ > sys/powerpc/include/_types.h:typedef int ___wchar_t; > sys/powerpc/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ > sys/powerpc/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ > sys/riscv/include/_types.h:typedef int ___wchar_t; > sys/riscv/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ > sys/riscv/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ > sys/sparc64/include/_types.h:typedef int ___wchar_t; > sys/sparc64/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ > sys/sparc64/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ > sys/x86/include/_types.h:typedef int ___wchar_t; > sys/x86/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ > sys/x86/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ >=20 > So only arm and arm64 have unsigned wchar_t types. >=20 > [NOTE: __CHAR16_TYPE__ and __CHAR32_TYPE__ are always unsigned: in = C++11 terms char16_t is like std::uint_least16_t and char32_t is like = std::uint_least32_t despite being distinct types. So __CHAR16_TYPE__ and = __CHAR32_TYPE__ are ignored below.] >=20 > The clang 3.8.0 compiler output has an odd mix for TARGET_ARCH=3Dpowerpc= and TARGET_ARCH=3Dpowerpc64 . . . >=20 > armv6 has unsigned types for both char and __WCHAR_TYPE__. > aarch64 has unsigned types for both char and __WCHAR_TYPE__. > powerpc has unsigned for char but signed for __WCHAR_TYPE__. > powerpc64 has unsigned for char but signed for __WCHAR_TYPE__. > amd64 has signed types for both char and __WCHAR_TYPE__. > i386 has signed types for both char and __WCHAR_TYPE__. > mips has signed types for both char and __WCHAR_TYPE__. > sparc64 has signed types for both char and __WCHAR_TYPE__. > (riscv is not covered by clang as I understand) >=20 > The details via compiler #define's. . . >=20 > # clang --target=3Darmv6-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 4294967295U > #define __WCHAR_TYPE__ unsigned int > #define __WCHAR_UNSIGNED__ 1 > #define __WCHAR_WIDTH__ 32 > . . . >=20 > # clang --target=3Daarch64-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 4294967295U > #define __WCHAR_TYPE__ unsigned int > #define __WCHAR_UNSIGNED__ 1 > #define __WCHAR_WIDTH__ 32 > . . . >=20 > # clang --target=3Dpowerpc-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . >=20 > Is powerpc wrong? >=20 > # clang --target=3Dpowerpc64-freebsd11 -std=3Dc99 -E -dM - < = /dev/null | more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > #define __CHAR_UNSIGNED__ 1 > . . . > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . >=20 > Is powerpc64 wrong? >=20 >=20 > # clang --target=3Damd64-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . >=20 > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . >=20 > # clang --target=3Di386-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more > . . . > #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . >=20 > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . >=20 >=20 > # clang --target=3Dmips-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . >=20 > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . >=20 > # clang --target=3Dsparc64-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more > . . . > #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ > . . . > #define __CHAR_BIT__ 8 > . . . (note the lack of __CHAR_UNSIGNED__) . . . >=20 > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . (note the lack of __WCHAR_UNSIGNED__) . . . >=20 >=20 >=20 > =3D=3D=3D > Mark Millard > markmi at dsl-only.net >=20 From owner-freebsd-toolchain@freebsd.org Thu Jul 14 09:53:40 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4016B92D6A for ; Thu, 14 Jul 2016 09:53:39 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-154.reflexion.net [208.70.211.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3ABD1A62 for ; Thu, 14 Jul 2016 09:53:39 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 13246 invoked from network); 14 Jul 2016 09:54:09 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 14 Jul 2016 09:54:09 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Thu, 14 Jul 2016 05:53:37 -0400 (EDT) Received: (qmail 1143 invoked from network); 14 Jul 2016 09:53:36 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 14 Jul 2016 09:53:36 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id BC0BEB1E001; Thu, 14 Jul 2016 02:53:29 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r302601 - in head/sys: arm/include arm64/include [clang 3.8.0: powerpc int instead of 32-bit SYSVR4's long and 64-bit ELF V2 long] From: Mark Millard In-Reply-To: <3DFF1DC9-2AE6-498A-9FE0-4970E76F8AB5@dsl-only.net> Date: Thu, 14 Jul 2016 02:53:29 -0700 Cc: svn-src-head@freebsd.org, FreeBSD Current , freebsd-stable@freebsd.org, freebsd-arm , FreeBSD PowerPC ML , FreeBSD Toolchain , Bruce Evans Content-Transfer-Encoding: quoted-printable Message-Id: <580A746B-3F02-44FA-AB2E-20CC71A1E9D2@dsl-only.net> References: <46153340-D2F4-48BD-B738-4792BC25FA3F@dsl-only.net> <38CF2C28-3BD1-4D09-939F-4DD0C2E8B58F@dsl-only.net> <3DFF1DC9-2AE6-498A-9FE0-4970E76F8AB5@dsl-only.net> To: Andrey Chernov X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 09:53:40 -0000 [Top post of a history note for powerpc and wchar_t's type in FreeBSD. = The history is from looking around in svn.] [The below is not a complaint or a request for a change. It just looks = like int for wchar_t for powerpc was a choice made long ago for simpler = code given FreeBSD's pre-existing structure.] int being used for powerpc wchar_t on FreeBSD goes back to at least = 2001-Jan-1. [FYI: "27 February, 2008: FreeBSD 7.0 is the first release = to officially support the FreeBSD/ppc port". So long before official = support.] wchar_t's type is one place where FreeBSD choose to override the powerpc = (and powerpc64) ABI standards (that indicate long, not int). I'm not = sure if this was implicit vs. explicitly realizing the ABI mismatch. = [The SYSVR4 32-bit powerpc ABI goes back to 1995.] I first traced the history back to 2002-Aug-23: -r102315 of = sys/sys/_types.h standardized FreeBSD on the following until the ARM = change: typedef int __ct_rune_t; typedef __ct_rune_t __rune_t; typedef __ct_rune_t __wchar_t; typedef __ct_rune_t __wint_t; Prior to this there was 2002-Aug-21's -r102227 = sys/powerpc/include/_types.h that used __int32_t. Prior to that had ansi.h and types.h instead of _types.h --and ansi.h = had: #define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) = */ . . . #define _BSD_CT_RUNE_T_ int /* arg type for ctype = funcs */ Going back to sys/powerpc/include/ansi.h's -r70571 (2001-Jan-1 creation = in svn): #define _BSD_WCHAR_T_ int /* wchar_t */ And the comments back then say: . . . It is not * unsigned so that EOF (-1) can be naturally assigned to it and used. . . . The reason an int was * chosen over a long is that the is*() and to*() routines take ints = (says * ANSI C), but they use __ct_rune_t instead of int. I've decided to not go any farther back in time (if there is prior = history for wchar_t for powerpc). Ignoring the temporary __int32_t use: FreeBSD has had its own powerpc = wchar_t type (int) for at least the last 15 years, at least when viewed = just relative to the powerpc ABI(s) FreeBSD is based on for powerpc. Modern gcc versions even have the FreeBSD wchar_t type correct for = powerpc variants in recent times: int. Previously some notation (L based = notation) used the wrong type for one of the powerpc variants (32-bit = vs. 64-bit), causing lots of false-positive compiler notices. gcc had = followed the ABI involved (long int) until the correction. =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-Jul-13, at 11:46 PM, Mark Millard = wrote: > On 2016-Jul-13, at 6:00 PM, Andrey Chernov = wrote: >=20 >> On 13.07.2016 11:53, Mark Millard wrote: >>> [The below does note that TARGET=3Dpowerpc has a mix of signed = wchar_t and unsigned char types and most architectures have both being = signed types.] >>=20 >> POSIX says nothing about wchar_t and char should be the same = (un)signed. >> It is arm ABI docs may say so only. They are different entities >> differently encoded and cross assigning between wchar_t and char is = not >> recommended. >=20 > [My "odd" would better have been the longer phrase "unusual for = FreeBSD" for the signed type mismatch point.] >=20 > C11 (9899:2011[2012]) and C++11 (14882:2011(E)) agree with your POSIX = note: no constraint to have the same signed type status as char. >=20 > But when I then looked at the "System V Application Binary Interface = PowerpC Processor Supplement" (1995-Sept SunSoft document) that I = believe FreeBSD uses for powerpc (32-bit only: TARGET_ARCH=3Dpowerpc) it = has: >=20 > typedef long wchar_t; >=20 > as part of: Figure 6-39 (page labeled 6-38). >=20 > While agreeing about the signed-type status for wchar_t this does not = agree with FreeBSD 11.0's use of int as the type: >=20 > sys/powerpc/include/_types.h:typedef int ___wchar_t; > sys/powerpc/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ > sys/powerpc/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ >=20 > # clang --target=3Dpowerpc-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more > . . . > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . >=20 > I'm not as sure of which document is official for = TARGET_ARCH=3Dpowerpc64 but using "Power Architecture 64-bit ELF V2 ABI = Specification" (Open POWER ABI for Linux Supplement) as an example of = what likely is common for that context: 5.1.3 Types Defined in Standard = header lists: >=20 > typedef long wchar_t; >=20 > which again does not agree with FreeBSD 11.0's use of int as the type: >=20 > # clang --target=3Dpowerpc64-freebsd11 -std=3Dc99 -E -dM - < = /dev/null | more > . . . > #define __WCHAR_MAX__ 2147483647 > #define __WCHAR_TYPE__ int > #define __WCHAR_WIDTH__ 32 > . . . >=20 >=20 > =3D=3D=3D > Mark Millard > markmi at dsl-only.net >=20 >=20 >>=20 >> On 2016-Jul-11, at 8:57 PM, Andrey Chernov = wrote: >>=20 >>> On 12.07.2016 5:44, Mark Millard wrote: >>>> My understanding of the criteria for __WCHAR_MIN and __WCHAR_MAX: >>>>=20 >>>> A) __WCHAR_MIN and __WCHAR_MAX: same type as the integer promotion = of >>>> ___wchar_t (if that is distinct). >>>> B) __WCHAR_MIN is the low value for ___wchar_t as an integer type; = not >>>> necessarily a valid char value >>>> C) __WCHAR_MAX is the high value for ___wchar_t as an integer type; = not >>>> necessarily a valid char value >>>=20 >>> It seems you are right about "not a valid char value", I'll back = this >>> change out. >>>=20 >>>> As far as I know arm FreeBSD uses unsigned character types (of = whatever >>>> width). >>>=20 >>> Probably it should be unsigned for other architectures too, clang = does >>> not generate negative values with L'' literals and locale use = only >>> positive values too. >>=20 >> Looking around: >>=20 >> # grep -i wchar sys/*/include/_types.h >> sys/arm/include/_types.h:typedef unsigned int ___wchar_t; >> sys/arm/include/_types.h:#define __WCHAR_MIN 0 = /* min value for a wchar_t */ >> sys/arm/include/_types.h:#define __WCHAR_MAX __UINT_MAX = /* max value for a wchar_t */ >> sys/arm64/include/_types.h:typedef unsigned int ___wchar_t; >> sys/arm64/include/_types.h:#define __WCHAR_MIN 0 = /* min value for a wchar_t */ >> sys/arm64/include/_types.h:#define __WCHAR_MAX __UINT_MAX = /* max value for a wchar_t */ >> sys/mips/include/_types.h:typedef int ___wchar_t; >> sys/mips/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ >> sys/mips/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ >> sys/powerpc/include/_types.h:typedef int ___wchar_t; >> sys/powerpc/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ >> sys/powerpc/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ >> sys/riscv/include/_types.h:typedef int ___wchar_t; >> sys/riscv/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ >> sys/riscv/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ >> sys/sparc64/include/_types.h:typedef int ___wchar_t; >> sys/sparc64/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ >> sys/sparc64/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ >> sys/x86/include/_types.h:typedef int ___wchar_t; >> sys/x86/include/_types.h:#define __WCHAR_MIN __INT_MIN = /* min value for a wchar_t */ >> sys/x86/include/_types.h:#define __WCHAR_MAX __INT_MAX = /* max value for a wchar_t */ >>=20 >> So only arm and arm64 have unsigned wchar_t types. >>=20 >> [NOTE: __CHAR16_TYPE__ and __CHAR32_TYPE__ are always unsigned: in = C++11 terms char16_t is like std::uint_least16_t and char32_t is like = std::uint_least32_t despite being distinct types. So __CHAR16_TYPE__ and = __CHAR32_TYPE__ are ignored below.] >>=20 >> The clang 3.8.0 compiler output has an odd mix for = TARGET_ARCH=3Dpowerpc and TARGET_ARCH=3Dpowerpc64 . . . >>=20 >> armv6 has unsigned types for both char and __WCHAR_TYPE__. >> aarch64 has unsigned types for both char and __WCHAR_TYPE__. >> powerpc has unsigned for char but signed for __WCHAR_TYPE__. >> powerpc64 has unsigned for char but signed for __WCHAR_TYPE__. >> amd64 has signed types for both char and __WCHAR_TYPE__. >> i386 has signed types for both char and __WCHAR_TYPE__. >> mips has signed types for both char and __WCHAR_TYPE__. >> sparc64 has signed types for both char and __WCHAR_TYPE__. >> (riscv is not covered by clang as I understand) >>=20 >> The details via compiler #define's. . . >>=20 >> # clang --target=3Darmv6-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more >> . . . >> #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> #define __CHAR_UNSIGNED__ 1 >> . . . >> #define __WCHAR_MAX__ 4294967295U >> #define __WCHAR_TYPE__ unsigned int >> #define __WCHAR_UNSIGNED__ 1 >> #define __WCHAR_WIDTH__ 32 >> . . . >>=20 >> # clang --target=3Daarch64-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more >> . . . >> #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> #define __CHAR_UNSIGNED__ 1 >> . . . >> #define __WCHAR_MAX__ 4294967295U >> #define __WCHAR_TYPE__ unsigned int >> #define __WCHAR_UNSIGNED__ 1 >> #define __WCHAR_WIDTH__ 32 >> . . . >>=20 >> # clang --target=3Dpowerpc-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more >> . . . >> #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> #define __CHAR_UNSIGNED__ 1 >> . . . >> #define __WCHAR_MAX__ 2147483647 >> #define __WCHAR_TYPE__ int >> #define __WCHAR_WIDTH__ 32 >> . . . (note the lack of __WCHAR_UNSIGNED__) . . . >>=20 >> Is powerpc wrong? >>=20 >> # clang --target=3Dpowerpc64-freebsd11 -std=3Dc99 -E -dM - < = /dev/null | more >> . . . >> #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> #define __CHAR_UNSIGNED__ 1 >> . . . >> #define __WCHAR_MAX__ 2147483647 >> #define __WCHAR_TYPE__ int >> #define __WCHAR_WIDTH__ 32 >> . . . (note the lack of __WCHAR_UNSIGNED__) . . . >>=20 >> Is powerpc64 wrong? >>=20 >>=20 >> # clang --target=3Damd64-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more >> . . . >> #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> . . . (note the lack of __CHAR_UNSIGNED__) . . . >>=20 >> #define __WCHAR_MAX__ 2147483647 >> #define __WCHAR_TYPE__ int >> #define __WCHAR_WIDTH__ 32 >> . . . (note the lack of __WCHAR_UNSIGNED__) . . . >>=20 >> # clang --target=3Di386-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more >> . . . >> #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> . . . (note the lack of __CHAR_UNSIGNED__) . . . >>=20 >> #define __WCHAR_MAX__ 2147483647 >> #define __WCHAR_TYPE__ int >> #define __WCHAR_WIDTH__ 32 >> . . . (note the lack of __WCHAR_UNSIGNED__) . . . >>=20 >>=20 >> # clang --target=3Dmips-freebsd11 -std=3Dc99 -E -dM - < /dev/null | = more >> . . . >> #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> . . . (note the lack of __CHAR_UNSIGNED__) . . . >>=20 >> #define __WCHAR_MAX__ 2147483647 >> #define __WCHAR_TYPE__ int >> #define __WCHAR_WIDTH__ 32 >> . . . (note the lack of __WCHAR_UNSIGNED__) . . . >>=20 >> # clang --target=3Dsparc64-freebsd11 -std=3Dc99 -E -dM - < /dev/null = | more >> . . . >> #define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__ >> . . . >> #define __CHAR_BIT__ 8 >> . . . (note the lack of __CHAR_UNSIGNED__) . . . >>=20 >> #define __WCHAR_MAX__ 2147483647 >> #define __WCHAR_TYPE__ int >> #define __WCHAR_WIDTH__ 32 >> . . . (note the lack of __WCHAR_UNSIGNED__) . . . >>=20 >>=20 >>=20 >> =3D=3D=3D >> Mark Millard >> markmi at dsl-only.net