Udostępnij za pośrednictwem


C4293 (poziom 1) ostrzeżenia kompilatora

"operator": przesunięcie liczba ujemna lub zbyt duże, niezdefiniowane zachowanie

Jeśli licznik shift jest ujemne lub zbyt duże, zachowanie obraz wynikowy jest niezdefiniowane.

Przykład

Poniższy przykład generuje C4293:

// C4293.cpp
// compile with: /c /W1
unsigned __int64 combine (unsigned lo, unsigned hi) {

   return (hi << 32) | lo;   // C4293

   // try the following line instead
   // return ( (unsigned __int64)hi << 32) | lo;
}