delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/16/21:57:45

From: robk AT cyberway DOT com DOT sg (Rob Kramer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Question on 'if' statements...
Date: Mon, 17 Jan 2000 10:39:25 +0800
Message-ID: <MPG.12ed01b3956c9526989693@news.cyberway.com.sg>
References: <38823564 DOT 37F9F865 AT ou DOT edu>
Organization: Infologic Pte Ltd
X-Newsreader: Anawave Gravity v2.00
NNTP-Posting-Host: 203.116.150.182
Lines: 22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <38823564 DOT 37F9F865 AT ou DOT edu>, davidis AT ou DOT edu says...
> Hello all,
> 
> I was wondering about how DJGPP would handle a very large if statement
> which contained alot of '&&' in it.  Does the compiler make it so that
> the instant it hits a 'false' value it breaks out, or does it continue
> through all of tests and then does the '&&' operation(s) later?  I need
> to know in order to try and optimize a program that I am writing.  Any
> help you can give will be greatly appreciated.  Thanks for you time.
> 
> -David C.
> 

This is not a compiler issue, but a C language feature as far as I know. 
The compiler terminates evaluation at the first 'false' in a && 
expression, or the first 'true' in a || expression.

Probably in the C language specs, but I never bothered to look it up :)

Cheers,

	RoB

- Raw text -


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