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

io_posix.cc:1377 error: comparison of integers of different signs: 'long long' and 'unsigned long long' #10926

Open
JMLX42 opened this issue Nov 7, 2022 · 2 comments
Labels
bug Confirmed RocksDB bugs up-for-grabs Up for grabs

Comments

@JMLX42
Copy link
Contributor

JMLX42 commented Nov 7, 2022

Expected behavior

The build runs without any warning.

Actual behavior

The following warning is shown (and handled as an error by default) :

io_posix.cc:1377:39: error: comparison of integers of different signs: 'long long' and 'unsigned long long' [-Werror,-Wsign-compare]

Steps to reproduce the behavior

mkdir build
cd build
cmake .. -DANDROID_PLATFORM=android-24 -DANDROID_ABI=armeabi-v7a -DANDROID_STL=c++_shared -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk-linux/build/cmake/android.toolchain.cmake
@akankshamahajan15
Copy link
Contributor

@JMLX42 Thanks for reporting it. Do you mind submitting a fix for it.

@akankshamahajan15 akankshamahajan15 added bug Confirmed RocksDB bugs up-for-grabs Up for grabs labels Nov 8, 2022
@JMLX42
Copy link
Contributor Author

JMLX42 commented Nov 13, 2022

FYI it happens with android-21 or later. Not before

The problem is most likely related to the fact that for the armv7 target, st_blksize and st_blocks do not have the same type:

https://chromium.googlesource.com/android_tools/+/20ee6d20/ndk/platforms/android-21/arch-arm/usr/include/sys/stat.h#119

  unsigned long st_blksize; \
  unsigned long long st_blocks; \

IMHO the only solution is to cast st_blksize to an unsigned long long when targeting Android. Would that be an acceptable solution @akankshamahajan15 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed RocksDB bugs up-for-grabs Up for grabs
Projects
None yet
Development

No branches or pull requests

2 participants