Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: wchar_t: signed or unsigned? |
| Date | 2014-04-21 14:08 -0700 |
| Organization | None to speak of |
| Message-ID | <lnsip6z8yo.fsf@nuthaus.mib.org> (permalink) |
| References | <4cial9tecgiks7ov2q3c1oo53492kvf3ti@4ax.com> <lj3v1q$otu$1@dont-email.me> <53558432.2040807@verizon.net> |
James Kuyper <jameskuyper@verizon.net> writes:
> On 04/21/2014 04:28 PM, Stephen Sprunk wrote:
> ...
>> N1570 7.19p2 says wchar_t "is an integer type whose range of values can
>> represent distinct codes for all members of the largest extended
>> character set specified among the supported locales; the null character
>> shall have the code value zero."
>>
>> N1570 7.20.3p4 says "If wchar_t (see 7.19) is defined as a signed
>> integer type, the value of WCHAR_MIN shall be no greater than −127 and
>> the value of WCHAR_MAX shall be no less than 127; otherwise, wchar_t is
>> defined as an unsigned integer type, and the value of WCHAR_MIN shall be
>> 0 and the value of WCHAR_MAX shall be no less than 255."
>>
>> So, whether wchar_t is signed or unsigned is implementation-defined,
>> just like with plain char.
>
> You posted that message slightly less than 2 hours after my message, in
> which I argued (based upon precisely those two clauses) that while the
> value of WCHAR_MIN is implementation-defined, and that value does
> uniquely determine the signedness of wchar_t, a conforming
> implementation is not required to more explicitly document that
> signedness. Are we in disagreement on that point?
The standard requires certain things to be documented, but says
vanishingly little about how they're to be documented.
The exact wording is:
An implementation shall be accompanied by a document that defines
all implementation-defined and locale-specific characteristics and
all extensions.
If the standard explicitly stated that the signedness of wchar_t
is implementation-defined, one could easily argue that documenting
the value of WCHAR_MIN would satisfy that requirement.
(And I do agree with your last paragraph.)
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
wchar_t: signed or unsigned? DSF <notavalid@address.here> - 2014-04-21 12:55 -0400
Re: wchar_t: signed or unsigned? Xavier Roche <xroche@free.fr.NOSPAM.invalid> - 2014-04-21 20:02 +0200
Re: wchar_t: signed or unsigned? Seungbeom Kim <musiphil@bawi.org> - 2014-04-21 11:07 -0700
Re: wchar_t: signed or unsigned? Keith Thompson <kst-u@mib.org> - 2014-04-21 11:24 -0700
Re: wchar_t: signed or unsigned? Seungbeom Kim <musiphil@bawi.org> - 2014-04-21 11:57 -0700
Re: wchar_t: signed or unsigned? James Kuyper <jameskuyper@verizon.net> - 2014-04-21 15:13 -0400
Re: wchar_t: signed or unsigned? James Kuyper <jameskuyper@verizon.net> - 2014-04-21 14:31 -0400
Re: wchar_t: signed or unsigned? Stephen Sprunk <stephen@sprunk.org> - 2014-04-21 15:28 -0500
Re: wchar_t: signed or unsigned? James Kuyper <jameskuyper@verizon.net> - 2014-04-21 16:48 -0400
Re: wchar_t: signed or unsigned? Keith Thompson <kst-u@mib.org> - 2014-04-21 14:08 -0700
Re: wchar_t: signed or unsigned? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-22 03:21 -0700
Re: wchar_t: signed or unsigned? Stephen Sprunk <stephen@sprunk.org> - 2014-04-22 10:48 -0500
Re: wchar_t: signed or unsigned? Keith Thompson <kst-u@mib.org> - 2014-04-22 09:10 -0700
Re: wchar_t: signed or unsigned? gordonb.8ql82@burditt.org (Gordon Burditt) - 2014-04-23 03:31 -0500
Re: wchar_t: signed or unsigned? Stephen Sprunk <stephen@sprunk.org> - 2014-04-25 10:00 -0500
Re: wchar_t: signed or unsigned? Keith Thompson <kst-u@mib.org> - 2014-04-25 09:00 -0700
Re: wchar_t: signed or unsigned? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-25 10:27 -0700
Re: wchar_t: signed or unsigned? Stephen Sprunk <stephen@sprunk.org> - 2014-04-25 16:43 -0500
csiph-web