编译器错误 C2193

“identifier”:已在段中

函数被使用 alloc_textcode_seg pragma 放置在两个不同的段中。

以下示例生成 C2193:

// C2193.cpp
// compile with: /c
extern "C" void MYFUNCTION();
#pragma alloc_text(MYCODE, MYFUNCTION)
#pragma code_seg("MYCODE2")
extern "C" void MYFUNCTION() {}   // C2193
extern "C" void MYFUNCTION2() {}