Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
src/common/util.h:366:9: error: ignoring return value of
'posix_memalign’ declared with attribute ‘warn_unused_result’
[-Werror=unused-result]
  • Loading branch information
evgenyz committed Mar 18, 2024
1 parent 5f1701b commit d19b89b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/common/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ static inline void *oscap_aligned_malloc(size_t size, size_t alignment) {
return _aligned_malloc(size, alignment);
#else
void *ptr = NULL;
posix_memalign(&ptr, alignment, size);
return ptr;
int ret = posix_memalign(&ptr, alignment, size);
if (ret == 0)
return ptr;
return NULL;
#endif
}

Expand Down

0 comments on commit d19b89b

Please sign in to comment.