[comp.lang.c++] cfront runs too fast

jeff@warwick.UUCP (Jeff Smith) (12/07/87)

If you can persuade cfront to finish in less than a second with the
+S option on, then the calculation of the number of lines processed
per second generates a divide-by-zero! On a SUN-3 with 1.2.1,
typing
        cfront +S </dev/null
will demonstrate the problem.

Fix main.c thus:

		fprintf(stderr,"real time delay %ld: %d lines per second\n",
#ifdef	CFRONTTOOFASTFIX
			stop_time-start_time,
			stop_time-start_time > 0 ?
				Nline/(stop_time-start_time) : Nline);
#else	!CFRONTTOOFASTFIX
			stop_time-start_time, Nline/(stop_time-start_time) );
#endif	CFRONTTOOFASTFIX
		fflush(stderr);


Jeff
warwick!jeff

PS. Does anyone have a fix to simpl.c for the null dereference
on Pfct f = Pfct(Pptr(q->tp)->typ) caused by the pointer to member function
problem? The problem's been noted a couple of times in comp.lang.c++, by
Paul Calder and others..