Skip to content

Fix compilation error using CLANG#13864

Closed
cbi42 wants to merge 1 commit intofacebook:mainfrom
cbi42:fix-mmap
Closed

Fix compilation error using CLANG#13864
cbi42 wants to merge 1 commit intofacebook:mainfrom
cbi42:fix-mmap

Conversation

@cbi42
Copy link
Contributor

@cbi42 cbi42 commented Aug 11, 2025

Summary: fix the following error showing up in continuous tests:

Makefile:186: Warning: Compiling in debug mode. Don't use the resulting binary in production
port/mmap.cc:46:15: error: first argument in call to 'memcpy' is a pointer to non-trivially copyable type 'rocksdb::MemMapping' [-Werror,-Wnontrivial-memcall]
   46 |   std::memcpy(this, &other, sizeof(*this));
      |               ^
port/mmap.cc:46:15: note: explicitly cast the pointer to silence this warning
   46 |   std::memcpy(this, &other, sizeof(*this));
      |               ^
      |               (void*)
1 error generated.
make: *** [Makefile:2580: port/mmap.o] Error 1
make: *** Waiting for unfinished jobs....

Test plan: make USE_CLANG=1 j=150 check with

if [ -d /mnt/gvfs/third-party ]; then
echo "NOTE: Using fbcode build" >&2
FBCODE_BUILD="true"
# If we're compiling with TSAN or shared lib, we need pic build
PIC_BUILD=$COMPILE_WITH_TSAN
if [ "$LIB_MODE" == "shared" ]; then
PIC_BUILD=1
fi
source "$PWD/build_tools/fbcode_config_platform010.sh"
else
commented out.

@meta-cla meta-cla bot added the CLA Signed label Aug 11, 2025
@facebook-github-bot
Copy link
Contributor

@cbi42 has imported this pull request. If you are a Meta employee, you can view this in D80033441.

@facebook-github-bot
Copy link
Contributor

@cbi42 merged this pull request in 496eeba.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants