Jump to content

Recommended Posts

I have some trouble in compile, this warnings really annoying.

 

If anybody know what is fix of this, i will very thankful.

 

Sorry for my english.

 

Quote

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;
                          ^

                          
             ^
input_teen.cpp: In member function 'bool CInputTeen::ProcessHandshake(LPDESC, const void*, size_t, int&)':
input_teen.cpp:52:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  *((DWORD *) buf) = handshake ^ HANDSHAKE_XOR;
                 ^

                 
matrix_card.cpp: In function 'void MatrixCardRndCoordinate(long unsigned int&, long unsigned int&)':
matrix_card.cpp:79:30: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  for (register unsigned long i = 0; i < (ASLENGTH >> 1); i++)
                              ^
matrix_card.cpp: In function 'bool ChkCoordinate(long unsigned int, long unsigned int, const char*, const char*)':
matrix_card.cpp:102:30: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  for (register unsigned long i = 0; i < (ASLENGTH >> 1); i++)

 

 

minilzo.c:948:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned char));
 
minilzo.c:1008:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(IS_UNSIGNED(size_t));
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:1009:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(IS_SIGNED(lzo_ptrdiff_t));
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:1010:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(IS_SIGNED(lzo_sptr_t));
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:1011:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_ptr_t));
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:1012:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_moff_t));
  ^~~~~~~~~~~~~~~~~~~
minilzo.c: In function 'int _lzo_config_check()':
minilzo.c:1178:44: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    b = * (const unsigned short *) &u.x;
                                            ^
minilzo.c:1201:40: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    a = * (const lzo_uint32 *) &u.x;
                                        ^
minilzo.c:1242:21: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
   register unsigned j;
                     ^
minilzo.c:1133:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255);
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:1134:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0);
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:1172:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(sizeof(short) == 2);
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:1195:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == 4);
  ^~~~~~~~~~~~~~~~~~~
minilzo.c:79:16: warning: typedef '__lzo_compile_time_assert_fail' locally defined but not used [-Wunused-local-typedefs]
  { typedef int __lzo_compile_time_assert_fail[1 - 2 * !(expr)]; }
                ^
minilzo.c:885:41: note: in expansion of macro 'LZO_COMPILE_TIME_ASSERT'
 #  define COMPILE_TIME_ASSERT(expr)     LZO_COMPILE_TIME_ASSERT(expr)
                                         ^~~~~~~~~~~~~~~~~~~~~~~
minilzo.c:1221:2: note: in expansion of macro 'COMPILE_TIME_ASSERT'
  COMPILE_TIME_ASSERT(lzo_sizeof_dict_t == sizeof(lzo_dict_t));
  ^~~~~~~~~~~~~~~~~~~
minilzo.c: In function 'lzo_uint _lzo1x_1_do_compress(const unsigned char*, lzo_uint, unsigned char*, lzo_uint*, void*)':
minilzo.c:1612:27: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register const lzo_byte *ip;
                           ^~
minilzo.c:1630:28: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
   register const lzo_byte *m_pos;
                            ^~~~~
minilzo.c:1717:22: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
    register lzo_uint t = pd(ip,ii);
                      ^
minilzo.c:1728:23: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
     register lzo_uint tt = t - 18;
                       ^~
minilzo.c: In function 'int lzo1x_decompress(const unsigned char*, lzo_uint, unsigned char*, lzo_uint*, void*)':
minilzo.c:2018:21: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register lzo_byte *op;
                     ^~
minilzo.c:2019:27: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register const lzo_byte *ip;
                           ^~
minilzo.c:2020:20: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register lzo_uint t;
                    ^
minilzo.c:2025:27: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register const lzo_byte *m_pos;
                           ^~~~~
minilzo.c: In function 'int lzo1x_decompress_safe(const unsigned char*, lzo_uint, unsigned char*, lzo_uint*, void*)':
minilzo.c:2510:21: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register lzo_byte *op;
                     ^~
minilzo.c:2511:27: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register const lzo_byte *ip;
                           ^~
minilzo.c:2512:20: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register lzo_uint t;
                    ^
minilzo.c:2517:27: warning: ISO C++1z does not allow 'register' storage class specifier [-Wregister]
  register const lzo_byte *m_pos;
                           ^~~~~

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.