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: boolean usage |
| Date | 2011-05-24 09:20 -0700 |
| Organization | None to speak of |
| Message-ID | <lnd3j8ysrr.fsf@nuthaus.mib.org> (permalink) |
| References | (6 earlier) <kfn4o4rw1k6.fsf@x-alumni2.alumni.caltech.edu> <0.17f178172b2d68f08478.20110519114145BST.877h9nrmza.fsf@bsb.me.uk> <kfnaaeiv99q.fsf@x-alumni2.alumni.caltech.edu> <11ca5149-6af0-4903-843c-e9dd97947554@x38g2000pri.googlegroups.com> <kfnipt0sdbz.fsf@x-alumni2.alumni.caltech.edu> |
Tim Rentsch <txr@alumni.caltech.edu> writes:
[snip]
> That, _and_ the implementation must conform to all the other
> requirements given in the Standard. Consider the following
> program:
>
> _Bool a, b;
>
> /* somehow give 'b' a value, not by assigning to it but *
> * by some other means such as storing into it using an *
> * unsigned character array. */
>
> a = b;
>
> The assignment operation converts the _Bool value of the
> right-hand side to the type of the assignment expression, which is
> also _Bool. By 6.3.1.2p1, the result of the conversion must be 0
> or 1. By 6.3p2, the result of the conversion must also be the
> same value as the pre-conversion value. These two conditions can
> be satisfied simultaneously only if _Bool is constrained to just
> two defined values (those being 0 and 1).
Or if the program's behavior is undefined, because b holds a trap
representation.
>> The Committee's Response in DR335 says _Bool has an implementation
>> defined width. Has there been any advance on that?
>
> Something being implementation-defined isn't carte blanche;
> whatever its definition is, the implementation still must
> conform to the Standard's other requirements, which in this
> case imply that the width must be one. As of n1570, all the
> relevant sections - 6.3p2, 6.3.1.2p1, 6.5.16.1p2 - are all
> exactly the same as in n1256 (except for one unrelated new
> footnote having to do with converting NAN's to _Bool).
But for something to be implementation-defined, there must be at
least two possible choices (C99 3.4.4, 3.4.1). (I'm assuming that
the wording for "implementation-defined behavior" applies to other
things that are implementation-defined.)
Saying that the width of bool must be 1 and is implementation-defined is
inconsistent.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"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
boolean usage "dr.oktopus" <blindwilly@freeonline.zzn.com> - 2011-05-14 14:05 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-14 16:41 -0700
Re: boolean usage Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-15 04:18 +0100
Re: boolean usage "dr.oktopus" <blindwilly@freeonline.zzn.com> - 2011-05-14 23:12 -0700
Re: boolean usage Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-05-14 23:39 -0700
Re: boolean usage "Bill Cunningham" <nospam@nspam.invalid> - 2011-05-19 21:29 -0400
Re: boolean usage Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-05-19 22:49 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-20 09:17 -0700
Re: boolean usage gazelle@shell.xmission.com (Kenny McCormack) - 2011-05-20 17:14 +0000
Re: boolean usage Datesfat Chicks <datesfat.chicks@gmail.com> - 2011-05-15 10:58 -0400
Re: boolean usage Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-05-15 08:12 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-16 08:09 -0700
Re: boolean usage Datesfat Chicks <datesfat.chicks@gmail.com> - 2011-05-16 19:44 -0400
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-16 17:46 -0700
Re: boolean usage Datesfat Chicks <datesfat.chicks@gmail.com> - 2011-05-16 22:45 -0400
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-16 18:23 -0700
Re: boolean usage Jens <jens.gustedt@gmail.com> - 2011-05-16 23:37 -0700
Re: boolean usage James Kuyper <jameskuyper@verizon.net> - 2011-05-17 06:39 -0400
Re: boolean usage "Morris Keesan" <mkeesan@post.harvard.edu> - 2011-05-17 09:55 -0400
Re: boolean usage James Kuyper <jameskuyper@verizon.net> - 2011-05-17 21:17 -0400
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-17 16:50 -0700
Re: boolean usage Jens <jens.gustedt@gmail.com> - 2011-05-18 09:21 -0700
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-18 15:36 -0700
Re: boolean usage Jens <jens.gustedt@gmail.com> - 2011-05-19 00:20 -0700
Re: boolean usage Ralf Damaschke <rwspam@gmx.de> - 2011-05-19 09:04 +0000
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-19 01:13 -0700
Re: boolean usage Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-05-19 03:29 -0700
Re: boolean usage Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-19 11:41 +0100
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-19 11:24 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-19 11:55 -0700
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-19 14:40 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-19 15:48 -0700
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-23 18:26 -0700
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-23 18:29 -0700
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-23 18:27 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-24 00:11 -0700
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-24 00:48 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-24 09:16 -0700
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-24 10:10 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-24 10:48 -0700
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-25 10:18 -0700
Re: boolean usage gazelle@shell.xmission.com (Kenny McCormack) - 2011-05-19 21:53 +0000
Re: boolean usage Michael Press <rubrum@pacbell.net> - 2011-05-25 11:22 -0700
Re: boolean usage Kenneth Brody <kenbrody@spamcop.net> - 2011-05-25 16:10 -0400
Re: boolean usage Michael Press <rubrum@pacbell.net> - 2011-05-26 12:32 -0700
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-19 22:39 -0700
Re: boolean usage Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-20 12:57 +0100
Re: boolean usage Peter Nilsson <airia@acay.com.au> - 2011-05-22 17:52 -0700
Re: boolean usage Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-23 13:15 +0100
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-24 00:57 -0700
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-24 01:38 -0700
Re: boolean usage Keith Thompson <kst-u@mib.org> - 2011-05-24 09:20 -0700
Re: boolean usage Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-24 11:00 -0700
csiph-web