From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1006 invoked by alias); 28 Mar 2012 22:52:20 -0000 Received: (qmail 996 invoked by uid 22791); 28 Mar 2012 22:52:19 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from newsaf.bio.caltech.edu (HELO newsaf.bio.caltech.edu) (131.215.12.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Mar 2012 22:52:06 +0000 Received: from localhost ([127.0.0.1] helo=saf.bio.caltech.edu) by newsaf.bio.caltech.edu ([127.0.0.1]:25) with esmtp id 1SD1in-00040u-Ky - Using Exim-4.72 (MandrivaLinux) MTA (return-path ); Wed, 28 Mar 2012 15:52:05 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 28 Mar 2012 22:52:00 -0000 From: mathog To: Subject: Re: [bool wrapping] Request for warnings on implicit bool to int conversions In-Reply-To: References: <97d1c137f40ae4bd6c6f89bfdbdd02ce@saf.bio.caltech.edu> <4F7261EE.4060409@oracle.com> <87398tea9n.fsf@windlord.stanford.edu> <2528e1039cb3a3b7f83fdb41f312aa36@saf.bio.caltech.edu> Message-ID: X-Sender: mathog@caltech.edu User-Agent: Roundcube Webmail/0.7 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: mathog@caltech.edu X-SA-Exim-Scanned: No (on newsaf.bio.caltech.edu); SAEximRunCond expanded to false X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg00448.txt.bz2 On 28-Mar-2012 15:20, Michael Witten wrote: > However, it seems to me that toggling the value with the idiom: > > --b; > > is aesthetically preferable to the more elaborate: > > b = !b; Aesthetically, not logically. Neither of these makes the least bit of sense: one less than False one less than True A better solution for the aesthetics would have been (it is a bit late now) to implement the missing unary negation operator: !!b; //T->F, F->T That operator would save even more program characters for the other int types, where it would be equivalent to: (i==0 ? 1 : 0); Regards, David Mathog mathog@caltech.edu Manager, Sequence Analysis Facility, Biology Division, Caltech