BITNET mail follows

GROSSELL%UCHCECVM.BITNET at cunyvm.cuny.edu GROSSELL%UCHCECVM.BITNET at cunyvm.cuny.edu
Fri Jul 8 09:17:21 AEST 1988


Date:     Thu Jul 07 10:27:55 1988
From:     Gonzalo A. Rossello L. <GROSSELL at UCHCECVM>
Subject:  BUG! BUG! in Waterloo C 3.0 for VM/SP (370)
To:       Info-C List <Info-C at BRL.ARPA>
Cc:       <Info-C-Request at Research.ATT.COM>

   We  discovered  a  bug  in  Waterloo C 3.0  for  VM/SP.  Consider  de
following program:
-----------------------------cut here------------------------------------
#include <stdio>
#include <stdlib>

main(){
   int a;
   struct{
      int aa;
   }pp = { 1 };

   printf("Value of pp.aa before pre-incrementing: %d\n", pp.aa);
   a = (++pp.aa)  * 1 ;
   printf("Value of pp.aa after pre-incrementing: %d\n", pp.aa);
   printf("Value of a: %d\n",a);
}
-----------------------------cut here------------------------------------
Here is console log of its execution:
 load error (start
 EXECUTION BEGINS...
 Value of pp.aa before pre-incrementing: 1
 Value of pp.aa after pre-incrementing: 1
 Value of a: 2
 R; T=0.24/0.78 10:26:39 S=0K/0K
 sp cons close stop

   Clearly the  value of 'pp.aa'  after pre-incrementing should be  2. If
'aa' is not  a member of a struct  then everything is OK. Also  if we do
'a = (++pp.aa);' the value of 'pp.aa' is correctly incremented.
   Has anyone discovered other bugs in Waterloo C 3.0 for VM/SP?



More information about the Comp.lang.c mailing list