cl May Run Out of Memory When Compiling Many Files at Once

ID Number: Q60491

6.00 6.00a 6.00ax | 6.00 6.00a

MS-DOS | OS/2

buglist6.00 buglist6.00a buglist6.00ax fixlist7.00

Summary:

SYMPTOMS

Compiling large numbers of files in one compilation pass can cause an

"Out Of Memory" error. CL.EXE makes memory allocations for each file

it compiles and this memory is not freed until CL.EXE terminates.

This problem is most frequently encountered when passing wildcards to

the cl command, for example:

cl -c *.c

RESOLUTION

The best workaround is to use a makefile to govern the compilation of

large programs. Because NMAKE spawns CL.EXE separately for each

source module, the memory is returned to the operating system between

each source compilation.

STATUS

Microsoft has confirmed this to be a problem in C versions 6.0,

6.0a, and 6.0ax. This problem was corrected in C/C++ version 7.0.