Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation warning: taking address of packed member #6

Open
glebm opened this issue Oct 31, 2021 · 1 comment · May be fixed by #7
Open

Compilation warning: taking address of packed member #6

glebm opened this issue Oct 31, 2021 · 1 comment · May be fixed by #7

Comments

@glebm
Copy link

glebm commented Oct 31, 2021

_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 added a commit to glebm/libmpq that referenced this issue Oct 31, 2021
Fixes the following warning:

    mpq.c: In function ‘libmpq__block_open_offset’:
    mpq.c:698:128: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
      698 | pq__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) {
          |                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes mbroemme#6
@glebm glebm linked a pull request Oct 31, 2021 that will close this issue
@glebm
Copy link
Author

glebm commented Nov 1, 2021

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

glebm referenced this issue in diasurgical/libmpq Nov 2, 2021
Fixes the following warning:

    mpq.c: In function ‘libmpq__block_open_offset’:
    mpq.c:698:128: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
      698 | pq__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) {
          |                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant