CL /callcap







The positive and negative forms override each other, of course. Additionally, the /callcap option

and the /callcap- option


The /callcap option affects the generation of code at each function’s entry and exit, specifically to insert calls to profiling hooks named _CAP_Enter_Function at the entry and _CAP_Exit_Function at the exit. Each function receives as its one argument the address of the function that is being entered or left. The functions are called as if with the prototypes

void __stdcall _CAP_Enter_Function (void *pfn);
void __stdcall _CAP_Exit_Function (void *pfn); 

but with the additional expectation that the called functions preserve the caller’s registers.


The profiling hooks enabled by /callcap are inserted at very much the same places as those enabled by /Gh (at entry) and /GH (at exit). Though CL does not impose a syntactical incompatibility between /callcap and either /Gh or /GH, the back-end compiler (C2) certainly regards these options as incompatible and reacts to their joint specification by declaring an internal compiler error (C1001).

Documentation Status

Not even the existence of the /callcap option is admitted in the Product Documentation for Visual Studio .NET. However, the option is documented in the Compiler Reference for the Platform Builder in Windows CE .NET.