.I 0 1 +++Date last modified: 24-Nov-1995 .D 1 1 .I 2 2 Q: Which PC C/C++ compiler is best and what should I buy? .I 155 11 largely during the period following the Symantec acquisition of Zortech. As of version 6.1, the bugs were mostly fixed. Support of DOS graphics was also dropped, but an updated version of the excellent Flash Graphics package shipped with the Zortech versions is available from FlashTek, which also supplies improved versions of the 32-bit DOS extender and the pre-Symantec debugger. The current 7.0 release fixes almost all residual bugs and is significantly enhanced in the area of portability, supporting features of other DOS compilers such as the _interrupt keyword. One caveat - if you have any version prior to the 6.1 release, be sure to upgrade! .D 156 8 .I 228 1 Drawbacks include almost non-existent 3rd party support and the pervasive IDE .D 229 1 .I 232 2 GNU C/C++ (GCC, G++; also DJGPP, EMX) ------------------------------------- .D 233 2 .I 239 5 built-in in order to work in DOS's limited memory. The most popular of the DOS ports is DJGPP. OS/2 ports obviously don't share this limitation. The EMX port for OS/2 is among the best and is quite popular among OS/2 programmers. Along with SC++, WC++, and HC++, the gnu compilers round out the list of full ISO/ANSI/ARM compilers with explicit support for embedded systems. .D 240 5 .I 327 124 Q. Do have any samples? A: The following program was compiled using several DOS compilers with the results as noted below. The compilers tested are noted in the executable program's name as follows: Suffix Compiler Notes ------ -------- ----- _b45 Borland C 4.5 _b31 Borland C 3.1 _g32 gnu C (DJGPP 1.12M2) GO32 32-bit DOS extender _mc Dunfield Micro-C 3.13 _ms Microsoft C 8.0 Part of Visual C++ 1.5 _pc Mix Power C 2.2 _sc Symantec C 7.0 _s32 Symantec C 7.0 DOSX 32-bit DOS extender _wc Watcom C 10.0 _w32 Watcom C 10.0 DOS/4GW 32-bit DOS extender _zc Zortech C 3.0r4 _z32 Zortech C 3.0r4 DOSX 32-bit DOS extender All executables were compiled with maximum optimization and with other options (e.g. no exception handling for Borland 4.5) to assure minimum size of the executables. The results for Zortech and Borland are for comarison since both are several revision obsolete (however they do highlight the fact that if all you want to do is compile straight C code, sometimes the latest isn't always the greatest). The test file was selected as an example of a minimally useful standard C program. Some coding peculiarities were introduced to accomodate some non-standard features of the Micro-C library. The program listing is followed by execution and compile times. The machine used for the test was a 486/DX50 using Golden Bow's Vcache. Due to the presense of the cache and the small size of the program, the execution timings are probably only grossly representative. The timings for the DJGPP-compiled test includes timings for both the compilation and COFF-to-.EXE conversion required to produce a stand-alone executable. The compilation time listing for WCL386 is for the Watcom-compiled version using the DOS/4GW 32-bit DOS extender. ----[ Size.C ]---------------------------------------------------------------- #include #ifndef __MICROC__ #include #endif main(int argc, char *argv[]) { char buf[80], *ptr; FILE *me; if (NULL == (me = fopen("size.c", "r"))) { fputs("Can't open SIZE.C\n", stderr); return -1; } while (1) { if (NULL == fgets(buf, 80, me)) break; for (ptr = buf + strlen(buf) - 1; ptr >= buf && *ptr == '\n'; --ptr) { *ptr = '\0'; } printf("%s\n", buf); } return 0; } ----[ Dr.Out ]----------------------------------------------------------------  DR 3.00á  Disk vol "STACVOL_DSK" Directory of D:\BINK\CODE\WIP 12 Files totalling 192,477 bytes 602,865,664 Bytes free Size_mc Com 2,105 ..a.rwx 20 Nov 95 9:59:42 < Micro-C 3.13 Size_zc Com 8,035 ..a.rwx 20 Nov 95 9:59:00 < ZTC 3.0r4 Size_ms Com 8,049 ..a.rwx 20 Nov 95 10:09:50 < MSC 8.0 Size_b31 Com 8,776 ..a.rwx 20 Nov 95 10:11:24 < BC++ 3.1 Size_wc Com 9,318 ..a.rwx 20 Nov 95 10:03:46 < WC 10.0 Size_sc Com 10,528 ..a.rwx 20 Nov 95 10:04:48 < SC++ 7.0 Size_b45 Com 11,216 ..a.rwx 20 Nov 95 10:07:20 < BC++ 4.5 Size_pc Exe 13,312 ..a.rwx 20 Nov 95 10:12:40 < Mix Power C 2.2 Size_w32 Exe 25,994 ..a.rwx 20 Nov 95 10:21:44 < WC/DOS 4G/W Size_z32 Exe 27,941 ..a.rwx 20 Nov 95 10:17:44 < ZTC/DOSX Size_s32 Exe 29,149 ..a.rwx 20 Nov 95 10:18:42 < SC++/DOSX Size_g32 Exe 38,054 ..a.rwx 20 Nov 95 10:23:44 < DJGPP 1.12M2 ----[ Execution times ]------------------------------------------------------- SIZE_WC Elapsed time = 0.116001 Seconds < WC 10.0 SIZE_MS Elapsed time = 0.116579 Seconds < MSC 8.0 SIZE_B31 Elapsed time = 0.121079 Seconds < BC++ 3.1 SIZE_PC Elapsed time = 0.127011 Seconds < Mix Power C 2.2 SIZE_ZC Elapsed time = 0.218889 Seconds < ZTC 3.0r4 SIZE_SC Elapsed time = 0.221269 Seconds < SC++ 7.0 SIZE_MC Elapsed time = 0.226919 Seconds < Micro-C 3.13 SIZE_B45 Elapsed time = 0.232461 Seconds < BC++ 4.5 SIZE_Z32 Elapsed time = 0.233987 Seconds < ZTC/DOSX SIZE_G32 Elapsed time = 0.406291 Seconds < DJGPP 1.12M2 SIZE_S32 Elapsed time = 0.461156 Seconds < SC++/DOSX SIZE_W32 Elapsed time = 1.299404 Seconds < WC/DOS 4GW ----[ Compile times ]--------------------------------------------------------- PC (Mix Power C) 2.2 1.505081 Seconds CC (Micro-C) 3.13 1.843561 Seconds ZTC 3.0r4 1.948132 Seconds SC 7.0 3.002091 Seconds BCC 4.5 4.108201 Seconds BCC 3.1 4.586260 Seconds WCL 10.0 5.669630 Seconds WCL386 10.0 6.342555 Seconds CL (MSC) 8.0 6.697373 Seconds GCC (djgpp) 1.12M2 8.287935 Seconds ----[ finis ]-----------------------------------------------------------------