Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!umd5!brl-adm!adm!GROSSELL%UCHCECVM.BITNET@cunyvm.cuny.edu
From: GROSSELL%UCHCECVM.BITNET@cunyvm.cuny.edu
Newsgroups: comp.lang.c
Subject: BITNET mail follows
Message-ID: <16425@brl-adm.ARPA>
Date: 7 Jul 88 23:17:21 GMT
Sender: news@brl-adm.ARPA
Lines: 37

Date:     Thu Jul 07 10:27:55 1988
From:     Gonzalo A. Rossello L. 
Subject:  BUG! BUG! in Waterloo C 3.0 for VM/SP (370)
To:       Info-C List 
Cc:       

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

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?