I am trying to use CL 16.0 for x64 (VS 2010) to produce some readable 64-bit ASM code for an example, but CL insists on preallocating a ton of stack space (28h bytes), with the following line:
sub rsp, 40 ; 00000028H (actual value depends on number of local vars of course)
Question is, how can I disable this behavior? It is difficult to explain to the class and I like to show them clean, explicable code... My assumption is that "sub rsp, XXX" should allocate the exact space required by the local variables in the function.
Surely it doesn't need that extra space. On x86, this behavior seems to be controlled by the edit-and-continue switches (/Zi vs. /ZI), but these don't have any effect in the x64 case. Any idea how to make x64 CL only allocate as much stack as it actually needs?
Thanks in advance!