diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-06-22 13:18:31 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-06 10:09:04 -0700 |
commit | 66b400fa25992943f1278426b54f3109fb033407 (patch) | |
tree | 709ede5327498e3e4e30fd8391886b9456b0b856 /test | |
parent | 44a4d92c3db539f14dd0003723f3a79040dc937a (diff) | |
download | chrome-ec-66b400fa25992943f1278426b54f3109fb033407.tar.gz |
test/pinweaver: Fix clang compilation error
When building with clang -Waddress-of-packed-member, it throws a
warning:
test/pinweaver.c:2032:5: error: taking address of packed member 'data_length'
of class or structure 'pw_request_header_t' may result in an
unaligned pointer value [-Werror,-Waddress-of-packed-member]
&buf.request.header.data_length);
This is because struct pw_test_data_t is defined as __packed (actually,
its members are), which also implies a base alignment of 1 byte.
Tell the compiler that the structure must be aligned on a 4-byte
boundary, which fixes the issue above.
BRANCH=none
BUG=chromium:854924
TEST=make buildall -j
TEST=make CC=clang CFLAGS_y=-Waddress-of-packed-member run-pinweaver -j
Change-Id: I498ff311438303b3f648e370af580075dab613a9
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1111760
Commit-Ready: Allen Webb <allenwebb@google.com>
Reviewed-by: Allen Webb <allenwebb@google.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/pinweaver.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/pinweaver.c b/test/pinweaver.c index 2f105c7b0a..e832a8a2d9 100644 --- a/test/pinweaver.c +++ b/test/pinweaver.c @@ -23,7 +23,7 @@ struct pw_test_data_t { /* Reserve space for the variable length fields. */ uint8_t tpm_buffer_size[PW_MAX_MESSAGE_SIZE]; }; -}; +} PW_ALIGN_TO_WRD; /******************************************************************************/ /* Test data |