Yardım GCC49 sonrası protocol.h warning

  • Konuyu açan Konuyu açan DeadLyEscaPe
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 0
  • Gösterim Gösterim 656
Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

DeadLyEscaPe

Yardımsever Üye
Yardımsever Üye
Üye
Mesaj
524
Çözümler
33
Beğeni
129
Puan
940
Ticaret Puanı
0
Bu uyarıyı nasıl çözebilirim?

Warnnigs:
Genişlet Daralt Kopyala
In file included from desc.cpp:8:0:
protocol.h: In function 'const char* encode_2bytes(sh_int)':
protocol.h:14:16: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *((sh_int *) a) = ind;
                ^
protocol.h: In function 'const char* encode_4bytes(int)':
protocol.h:21:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *((int *) a) = ind;
             ^
Derleniyor -> desc_client.cpp
In file included from desc_client.cpp:7:0:
protocol.h: In function 'const char* encode_2bytes(sh_int)':
protocol.h:14:16: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *((sh_int *) a) = ind;
                ^
protocol.h: In function 'const char* encode_4bytes(int)':
protocol.h:21:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *((int *) a) = ind;
             ^
Derleniyor -> desc_manager.cpp
In file included from desc_manager.cpp:10:0:
protocol.h: In function 'const char* encode_2bytes(sh_int)':
protocol.h:14:16: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *((sh_int *) a) = ind;
                ^
protocol.h: In function 'const char* encode_4bytes(int)':
protocol.h:21:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *((int *) a) = ind;
             ^
desc_manager.cpp: In member function 'DWORD DESC_MANAGER::CreateHandshake()':
desc_manager.cpp:135:26: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   *(DWORD *) (crc_buf    ) = val;
                          ^
 
Geri
Üst