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

[CodeStyle] fix pragma-pack warning on macos #47399

Merged
merged 1 commit into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmake/flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ if(APPLE)
-Werror=braced-scalar-init
-Werror=uninitialized
-Werror=tautological-constant-out-of-range-compare
-Werror=literal-conversion)
-Werror=literal-conversion
-Werror=pragma-pack)
endif()

if(WITH_HETERPS AND WITH_PSLIB)
Expand Down
4 changes: 3 additions & 1 deletion paddle/fluid/operators/math/bloomfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ namespace paddle {
namespace operators {
namespace math {

#pragma pack(4)
#pragma pack(push, 4)
struct bloomfilter {
uint64_t magic_num;
uint64_t m;
uint64_t k;
uint64_t count;
unsigned char bit_vector[1];
};
#pragma pack(pop)

int bloomfilter_get(const struct bloomfilter *bloomfilter,
const void *key,
size_t len);
Expand Down