Commit a4f460ab authored by Vlad Tsyrklevich's avatar Vlad Tsyrklevich Committed by Commit Bot

Fix warn_unused_result attribute failure

On some libcs posix_memalign is defined with warn_unused_result. Check
its return value and handle it appropriately in this test.

Change-Id: Iaa7151fe101b0dfc04192229a9a8751e1f92507f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1507037
Auto-Submit: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: default avatarVitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638388}
parent 629b06d5
...@@ -135,9 +135,10 @@ MULTIPROCESS_TEST_MAIN_WITH_SETUP( ...@@ -135,9 +135,10 @@ MULTIPROCESS_TEST_MAIN_WITH_SETUP(
#if defined(OS_POSIX) #if defined(OS_POSIX)
EXPECT_TRUE(allocationCheck( EXPECT_TRUE(allocationCheck(
[&] { [&]() -> void* {
void* ptr; void* ptr;
posix_memalign(&ptr, page_size, page_size); if (posix_memalign(&ptr, page_size, page_size))
return nullptr;
return ptr; return ptr;
}, },
&free, &failures)); &free, &failures));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment