使用
#pragma optimize("", off)
关闭编译器的优化选项
#include <Windows.h>
#include <stdio.h>
#pragma optimize("", off)
void code()
{
printf("hehe \n");
}
void code_end()
{
}
#pragma optimize("", on)
int main()
{
printf("code len %d \n",(ULONG)code_end - (ULONG)code);
return 0;
}