]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/journal/journal-file.c
journal: disable -Waddress-of-packed-member under clang
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Nov 2017 21:54:39 +0000 (22:54 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Nov 2017 22:10:25 +0000 (23:10 +0100)
commit518044605173fee73f9e4b08a62624ae4b4f5bd2
tree47fd13f014c0e70fad0e2f49330773d93564f200
parentecc3f340abda85325df862ab2da612a78bf34926
journal: disable -Waddress-of-packed-member under clang

clang warns about a few sites like this:
../src/journal/journal-file.c:1780:48: warning: taking address of packed member 'entry_offset' of class or structure 'DataObject' may result in an unaligned pointer value [-Waddress-of-packed-member]
                                              &o->data.entry_offset,
                                               ^~~~~~~~~~~~~~~~~~~~
but DataObject.entry_offset will always be 8-byte aligned as long as
the DataObject structure is aligned. Similarly in other cases, the
field is always aligned. Let's just silence the warning to avoid noise.

gcc does not know -Waddress-of-packed-member, and would warn about an unknown
warning, so we need to conditionalize on __clang__.
src/journal/journal-file.c