Skip to content

Using the correct cast instead of static_cast#155

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

Using the correct cast instead of static_cast#155
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented May 21, 2014

clang won't compile with static_cast in bd1105a#diff-5b717965879a622d11268aaf03fb19c8R1518 .
In fact replacing static_cast with reinterpret_cast works.

clang++ -g -Wall -Werror -I. -I./include -std=c++11  -DROCKSDB_PLATFORM_POSIX  -DOS_MACOSX -DROCKSDB_ATOMIC_PRESENT -DSNAPPY -DGFLAGS=google -DZLIB -DBZIP2   -DHAVE_JEMALLOC -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -Woverloaded-virtual -c util/build_version.cc -o util/build_version.o
clang++ -g -Wall -Werror -I. -I./include -std=c++11  -DROCKSDB_PLATFORM_POSIX  -DOS_MACOSX -DROCKSDB_ATOMIC_PRESENT -DSNAPPY -DGFLAGS=google -DZLIB -DBZIP2   -DHAVE_JEMALLOC -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -Woverloaded-virtual -c util/env_posix.cc -o util/env_posix.o
util/env_posix.cc:1518:19: error: static_cast from '_opaque_pthread_t *' to 'unsigned long long' is not allowed
                  static_cast<long long unsigned int>(terminating_thread));
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

ghost referenced this pull request May 21, 2014
Summary: Per request from @nkg-, temporarily print thread ID when a thread terminates. It is a temp solution as we try to minimized stderr messages.

Test Plan: env_test

Reviewers: haobo, igor, dhruba

Reviewed By: igor

CC: nkg-, leveldb

Differential Revision: https://reviews.facebook.net/D18753
@ghost
Copy link
Copy Markdown
Author

ghost commented May 21, 2014

my bad, ci failed with gcc.

@ghost
Copy link
Copy Markdown
Author

ghost commented May 21, 2014

It looks like a platform-dependent problem.

Under the Linux, rocksdb works fine without this patch, while under the OSX not.

And I should post here what the travis-ci complains with this patch:

g++ -g -Wall -Werror -I. -I./include -std=c++11 -DROCKSDB_PLATFORM_POSIX -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_ATOMIC_PRESENT -DSNAPPY -DGFLAGS=google -DZLIB -DBZIP2 -DHAVE_JEMALLOC -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -Woverloaded-virtual -c utilities/backupable/backupable_db.cc -o utilities/backupable/backupable_db.o

util/env_posix.cc: In member function ‘void rocksdb::{anonymous}::PosixEnv::ThreadPool::BGThread(size_t)’:

util/env_posix.cc:1518:78: error: invalid cast from type ‘long unsigned int’ to type ‘long long unsigned int’

reinterpret_cast<long long unsigned int>(terminating_thread));

Closing it.

@ghost ghost closed this May 21, 2014
@ghost ghost mentioned this pull request May 21, 2014
Nazgolze pushed a commit to Nazgolze/rocksdb-1 that referenced this pull request Sep 21, 2021
BusyJay pushed a commit to BusyJay/rocksdb that referenced this pull request Jul 25, 2022
Summary:
Fix missing check for openssl in db_bench.

Test Plan:
build without openssl

Signed-off-by: Yi Wu <yiwu@pingcap.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants