int i;
for (i=0;i<100;i++){
 int ret = func(i);
 if(ret < 0) perror("Error");
}