Condividi tramite


Avviso del compilatore (livello 1) C4293

Aggiornamento: novembre 2007

Messaggio di errore

'operatore': calcolo shift negativo o troppo grande. Comportamento indefinito
'operator' : shift count negative or too big, undefined behavior

Se un calcolo shift è negativo o troppo grande, il comportamento dell'immagine risultante è indefinito.

Esempio

Nell'esempio seguente viene generato l'errore 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;
}