Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!.POSTED!not-for-mail |
|---|---|
| From | Willem <willem@toad.stack.nl> |
| Newsgroups | comp.lang.c |
| Subject | Re: c99 and the lack of warnings when int operations are applied to a bool |
| Date | Fri, 27 Apr 2012 20:16:56 +0000 (UTC) |
| Organization | Stack Usenet News Service |
| Lines | 37 |
| Message-ID | <slrnjplvlo.v3t.willem@toad.stack.nl> (permalink) |
| References | <jki5iu$jea$1@dont-email.me> <jkinde$or2$1@speranza.aioe.org> <jksrbo$p2a$1@dont-email.me> <jnbd7q$17a$1@dont-email.me> <jnbhej$ovn$1@dont-email.me> <jncspr$on8$1@dont-email.me> <jncuh1$ls$1@dont-email.me> <jnd0fk$8vk$1@dont-email.me> <jndsiu$60v$1@dont-email.me> <slrnjploaa.bth.willem@toad.stack.nl> <4F9AF44F.3040307@verizon.net> |
| NNTP-Posting-Host | toad.stack.nl |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Trace | mud.stack.nl 1335557816 48394 2001:610:1108:5010::135 (27 Apr 2012 20:16:56 GMT) |
| X-Complaints-To | abuse@stack.nl |
| NNTP-Posting-Date | Fri, 27 Apr 2012 20:16:56 +0000 (UTC) |
| User-Agent | slrn/0.9.9p1 (FreeBSD) |
| Xref | csiph.com comp.lang.c:20009 |
Show key headers only | View raw
James Kuyper wrote:
) On 04/27/2012 02:11 PM, Willem wrote:
)> James Kuyper wrote:
)> ) On 04/26/2012 10:32 PM, Eric Sosman wrote:
)> )> The question that burns in my feeble brain is: "Why?" What is
)> )> the benefit that a "No arithmetic on booleans" rule would bring?
)> )
)> ) It makes syntax errors out of constructs that are conceptually
)> ) meaningless, forcing the use of alternative constructs that say more
)> ) precisely what is actually going on. As such, it makes it easier to
)> ) detect erroneous constructs.
)>
)> It also makes syntax errors out of constructs that are perfectly
)> meaningful, forcing the use of needless extra boilerplate code
)> that only serves to muddle what is actually going on.
)
) I deny the fundamental meaningfullness of any code that treats a logical
) value as if it were numeric. What does true*3+false mean? It has a
) specific numeric meaning, one that almost any C programmer would know -
) but only because C arbitrarily gave it that meaning, not because it has
) any inherent meaning. It's intrinsically meaningless to multiply a truth
) value by 3.
My apologies, I had misunderstood the statement as: "No using arbitratry
expressions as booleans", but for the other way round, calculating with
booleans, I almost(*) completely agree with you.
*) Bit-shifting is an exception, IMO.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
c99 and the lack of warnings when int operations are applied to a bool mathog <dmathog@gmail.com> - 2012-03-23 08:40 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-03-23 12:07 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool jacob navia <jacob@spamsink.net> - 2012-03-23 21:45 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Robert Wessel <robertwessel2@yahoo.com> - 2012-03-23 17:17 -0500
Re: c99 and the lack of warnings when int operations are applied to a bool jacob navia <jacob@spamsink.net> - 2012-03-23 23:29 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Ian Collins <ian-news@hotmail.com> - 2012-03-24 11:48 +1300
Re: c99 and the lack of warnings when int operations are applied to a bool jacob navia <jacob@spamsink.net> - 2012-03-24 23:47 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Willem <willem@toad.stack.nl> - 2012-03-25 09:05 +0000
Re: c99 and the lack of warnings when int operations are applied to a bool "BartC" <bc@freeuk.com> - 2012-03-25 11:30 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-25 21:05 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Lowell Gilbert <lgusenet@be-well.ilk.org> - 2012-03-25 16:15 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-25 22:14 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-03-25 23:46 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-26 12:05 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Lowell Gilbert <lgusenet@be-well.ilk.org> - 2012-03-26 15:22 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Gareth Owen <gwowen@gmail.com> - 2012-03-25 11:44 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-25 13:06 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-27 11:12 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool Robert Wessel <robertwessel2@yahoo.com> - 2012-03-24 01:15 -0500
Re: c99 and the lack of warnings when int operations are applied to a bool jacob navia <jacob@spamsink.net> - 2012-03-24 23:29 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool mathog <dmathog@gmail.com> - 2012-03-27 09:53 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool Keith Thompson <kst-u@mib.org> - 2012-03-27 11:07 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-03-27 14:16 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-04-26 07:57 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool jacob navia <jacob@spamsink.net> - 2012-04-26 14:08 +0200
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-04-26 09:09 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-04-26 21:29 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-04-26 21:58 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-04-26 22:32 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-04-27 06:31 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Lanarcam <lanarcam1@yahoo.fr> - 2012-04-27 19:26 +0200
Re: c99 and the lack of warnings when int operations are applied to a bool Keith Thompson <kst-u@mib.org> - 2012-04-27 11:28 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool Lanarcam <lanarcam1@yahoo.fr> - 2012-04-27 20:51 +0200
Re: c99 and the lack of warnings when int operations are applied to a bool ImpalerCore <jadill33@gmail.com> - 2012-04-27 12:17 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool Jens Gustedt <jens.gustedt@loria.fr> - 2012-04-28 09:17 +0200
Re: c99 and the lack of warnings when int operations are applied to a bool Keith Thompson <kst-u@mib.org> - 2012-04-28 13:26 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool Willem <willem@toad.stack.nl> - 2012-04-27 18:11 +0000
Re: c99 and the lack of warnings when int operations are applied to a bool ImpalerCore <jadill33@gmail.com> - 2012-04-27 12:05 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-04-27 15:32 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Willem <willem@toad.stack.nl> - 2012-04-27 20:16 +0000
Re: c99 and the lack of warnings when int operations are applied to a bool James Kuyper <jameskuyper@verizon.net> - 2012-04-27 16:45 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Rui Maciel <rui.maciel@gmail.com> - 2012-04-27 21:26 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-04-27 21:18 -0400
Re: c99 and the lack of warnings when int operations are applied to a bool Rui Maciel <rui.maciel@gmail.com> - 2012-04-27 21:33 +0100
Re: c99 and the lack of warnings when int operations are applied to a bool Keith Thompson <kst-u@mib.org> - 2012-04-27 15:36 -0700
Re: c99 and the lack of warnings when int operations are applied to a bool ImpalerCore <jadill33@gmail.com> - 2012-04-27 08:31 -0700
csiph-web