Mail Archives: djgpp/1998/01/28/11:45:33
Fernando wrote:
> 
> hmmm, interesting, but now, what happens with this small program:
> 
> #define    TRUE    1
> int main(void){
> int    i = 1 ;
>     while (i == TRUE);
> }
> 
> and with this variant:
> #define    TRUE    (1 == 1)
> int main(void){
>     while (TRUE) ;
> }
> 
> Are they accesing memory ? I think the first one is doing it but I am
> not sure about the second one.
If I am right, the second one is equal to while(1), because the
compiler can evaluate it a compile time, so you shouldn't
be able to ^C. 
The second one. Well I guess it depends on the optimisation 
level. Why not not just go and try? Or did you and just 
want to prove me wrong ;-)
Ciao
Tom
*************************************************************
* Thomas Demmer                                             *
* Lehrstuhl fuer Stroemungsmechanik                         *
* Ruhr-Uni-Bochum                                           *
* Universitaetsstr. 150                                     *
* D-44780  Bochum                                           *
* Tel: +49 234 700 6434                                     *
* Fax: +49 234 709 4162                                     *
* http://www.lstm.ruhr-uni-bochum.de/~demmer                *
*************************************************************
- Raw text -