www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/04/23:00:54

From: (SED AT ticnet DOT com)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Optimizer and logical operators.
Date: Sat, 05 Sep 1998 02:52:02 GMT
Organization: The Internet Connection - ticnet.com (using Airnews.net!)
Lines: 35
Message-ID: <A72E66592915E3D4.25EBC0B94D40970C.0EACE07DC2BCD858@library-proxy.airnews.net>
References: <4D580E8D0A378A4D DOT 13E50F10CD0F8074 DOT 909D1CC8A7C84CD0 AT library-proxy DOT airnews DOT net> <1998Sep4 DOT 121057 DOT 1208 AT catorobots DOT ox DOT ac DOT uk>
Abuse-Reports-To: abuse at ticnet.com to report improper postings
NNTP-Proxy-Relay: library.airnews.net
NNTP-Posting-Time: Fri Sep 4 21:52:47 1998
NNTP-Posting-Host: d-ft#+<VdtBe1BFCh,,>Bl.F%+TMKB (Encoded at Airnews!)
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Fri, 4 Sep 1998 12:10:57 GMT, Neil Townsend wrote:

>In comp.os.msdos.djgpp (SED AT ticnet DOT com) writes:
>>So I should be able to rewrite:
>>
>>while( (*p1 != '\0') && isspace( *p1 ) )
>>    ++p1;
>>
>>as
>>
>>while( (*p1 != '\0') && isspace( *(p1++) ) );
>
>You could, but there would be a subtle change in functionality. In your
>original code, p1 was incremented if the string hadn't ended and it pointed
>to a spcae character. In the second line, p1 might be incremented one more
>time: If the string hasn't ended and p1 point to a non-space character it
>will still be incremented (because the increment is no longer conditional on
>the success of the second clause). The loop will end in one of two ways:
<snip>
>Neil

Oops!

On  Thu, 03 Sep 1998 18:51:22 -0300, Endlisnis wrote:
>	Yes.  The optimizer should not change what your code does, just how it does
>it.  There are some very rare cases (usually when you try something tricky)
>where the optimizer will get confused, but you shouldn't worry about these
>problems unless you experience them.
>-- 
>     (\/) Endlisnis (\/)

Thanks for the info!

Matt Darland

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019