CL /Zs


This option has no arguments. It is /Zs only.


The /Zs option weakly overrides /Gm. It does not pass to any compiler module.


The /Zs option leaves only the front-end C and C++ compilers as active. It disables all the remaining build stages: namely, Processing, Generating Code and Linking (though Processing can later be enabled by following with /B1_5).

Since the option is not passed to any compiler modules, its sole action is to constrain the build to the front-end C and C++ compilers. What they do for the build is exactly whatever they would have done had /Zs not been given. In most practical cases, the front-end compilers produce as output files only the so-called intermediate files that are the main communication to the back end (for code generation), and these files are deleted by CL after the build. The only lasting effect of /Zs is therefore to have found what errors and warnings would otherwise have been produced by the front-end compilers, given whatever other options are specified. Put another way, the /Zs option limits compilation to a syntax check of the C and C++ source files.

Remember however that the front-end compilers do not know whether /Zs has been given. Whatever intermediate files that they produce are exactly as they would have been without the /Zs option. If /Bk is also given, then CL does not delete the intermediate files and the build can be resumed by re-running CL with /BK.

If other options cause front-end compilation to produce output files, then these too will be exactly the same with or without the /Zs option. For example, if /Fx is given with /Zs, then the “syntax check” still produces whatever .MRG file would have resulted from full compilation. The same applies to other output such as PCH and PDB files.