[comp.os.msdos.programmer] Turbo C++ Bug

crh@hpcvmcdj.cv.hp.com (Ron Henderson) (06/29/90)

And yet Another TC C++ 1.00 bug.....

The following code when compiled in huge model (using tcc -mh file)
should print:

OK
ok


it instead prints:

OK
NOT ok

/*========================================================================*/
#define X (4 == sizeof(void *))

#if X
	void p(){printf("ok\n");}
#else
	void p(){printf("NOT ok\n");}
#endif

main()
{
#if X
	printf("OK\n");
#else
	printf("not OK\n");
#endif
	p();
}
/*========================================================================*/

The first '#if X' is not being processed correctly while the second
'#if X' is being processed correctly.

This error occurs with the IDE and command line compilers.  
This error has been reported to Borland.  The Borland tech compiled and 
executed the program.  He confirmed the problem.

Ron Henderson
crh@cv.hp.com