共用方式為


編譯器警告 (層級 3) C4414

'function' : 短跳至轉換成接近的函式

簡短跳躍會產生精簡的指令,其分支到從指令有限範圍內到位址的指示。 指令包含短位移,代表跳躍與目標位址、函式定義之間的距離。 在連結函式期間,可能會移動或受限於鏈接時間優化,導致函式從短位移移出可觸達的範圍。 編譯程式必須產生跳躍的特殊記錄,這需要 jmp 指令為 NEAR 或 FAR。 編譯程式進行轉換。

例如,下列程式代碼會產生 C4414:

// C4414.cpp
// compile with: /W3 /c
// processor: x86
int DoParityEven();
int DoParityOdd();
unsigned char global;
int __declspec(naked) DoParityEither()
{
   __asm
   {
      test global,0
      jpe SHORT DoParityEven  // C4414
      jmp SHORT DoParityOdd   // C4414
   }
}