RE:assert

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Wed Feb 16 2000 - 22:07:37 MET


Dear Sean,

Thank you for reporting this problem. This is a problem of cint
bytecode. Assert was handled in special way and that was not compiled
into bytecode. I'll fix this in 5.14.32. It will work f you do

  $ cint -O0 test.cxx

Thank you
Masaharu Goto

>
>Dear Rooters
>
>The code below compiles and executes okay under the SC4.2. Under CINT
>it fails, my guess is that CINT doesn't parse assert(my_func()) correctly.
>
>thanks for any info
>
>Sean 
>
>#include <iostream.h>
>#include <stdlib.h>
>#include <assert.h>
>#include <math.h>
>#include <time.h>
>
>int my_func();
>int main();
>
>int main(){
>  time_t tt1;
>  srand((long) time(&tt1));
>  for(;;){
>    assert(my_func());
>  }
>}
>
>int my_func(){
>  static int i=0;
>  float val = 1.0*rand()/RAND_MAX;
>  cout << ++i << '\t' << val << endl;
>  if(val>0.5){
>    return 0;
>  }else{
>    return 1;
>  }
>}
>
>
>_______________________________________________
>
>Sean Kelly             Office:    510-495-2304
>Dept. of Physics       Fax:       510-486-7379
>UCLA                   Home:      415-863-9819 
>_______________________________________________
>



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:19 MET