mbroemme / libmpq

libmpq is a library for manipulating MPQ (MoPaQ) archives, which are used by Blizzard in most of their games (e.g., Diablo, Diablo 2, StarCraft, WarCraft 3, and World of Warcraft).
http://libmpq.org
GNU General Public License v2.0
37 stars 13 forks source link

Compilation warning: taking address of packed member #6

Open glebm opened 3 years ago

glebm commented 3 years ago
_deps/libmpq-src/libmpq/mpq.c: In function ‘libmpq__block_open_offset’:
_deps/libmpq-src/libmpq/mpq.c:696:128: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  696 |    if (libmpq__decrypt_key((uint8_t *)mpq_archive->mpq_file[file_number]->packed_offset, packed_size, mpq_archive->block_size, &mpq_archive->mpq_file[file_number]->seed) < 0) {
      |                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glebm commented 3 years ago

Another one:

explode.c: In function ‘libmpq__do_decompress_pkzip’:
explode.c:542:73: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  542 |  mpq_pkzip->in_bytes   = mpq_pkzip->read_buf((char *)mpq_pkzip->in_buf, &mpq_pkzip->in_pos, mpq_pkzip->param);
      |                                                                         ^~~~~~~~~~~~~~~~~~