facebook / mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.
http://myrocks.io
Other
2.48k stars 714 forks source link

Fix MyRocks compilation under XCode 15 #1364

Closed laurynas-biveinis closed 1 year ago

laurynas-biveinis commented 1 year ago

This fixes the errors listed below. For the array argument, fix by converting the arrays to pointers as this is what gets passed around anyway.

/Users/laurynas/vilniusdb/xcode-15-fixes/storage/rocksdb/rdb_datadic.cc:5528:9: error: format specifies type 'unsigned int' but the argument has type 'uint16_t' (aka 'unsigned short') [-Werror,-Wformat] index_info->m_index_dict_version, index_info->m_index_type, ^~~~~~~~ /Users/laurynas/vilniusdb/xcode-15-fixes/storage/rocksdb/rdb_datadic.cc:5528:43: error: format specifies type 'unsigned int' but the argument has type 'uchar' (aka 'unsigned char') [-Werror,-Wformat] index_info->m_index_dict_version, index_info->m_index_type, ^~~~~~~~ /Users/laurynas/vilniusdb/xcode-15-fixes/storage/rocksdb/rdb_datadic.cc:5529:9: error: format specifies type 'unsigned int' but the argument has type 'uint16_t' (aka 'unsigned short') [-Werror,-Wformat] index_info->m_kv_version, index_info->m_ttl_duration); ^~~~~~~~ 3 errors generated.

/Users/laurynas/vilniusdb/xcode-15-fixes/storage/rocksdb/ha_rocksdb.cc:14077:34: error: argument 'buf' of type 'uchar[8]' (aka 'unsigned char[8]') with mismatched bound [-Werror,-Warray-parameter] const Rdb_key_def &kd, uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE 2]) { ^ /Users/laurynas/vilniusdb/xcode-15-fixes/storage/rocksdb/./ha_rocksdb.h:406:64: note: previously declared as 'uchar[]' (aka 'unsigned char[]') here static rocksdb::Range get_range(const Rdb_key_def &kd, uchar buf[]); ^ /Users/laurynas/vilniusdb/xcode-15-fixes/storage/rocksdb/ha_rocksdb.cc:14086:24: error: argument 'buf' of type 'uchar[8]' (aka 'unsigned char[8]') with mismatched bound [-Werror,-Warray-parameter] const int i, uchar buf[Rdb_key_def::INDEX_NUMBER_SIZE 2]) const { ^ /Users/laurynas/vilniusdb/xcode-15-fixes/storage/rocksdb/./ha_rocksdb.h:391:47: note: previously declared as 'uchar[]' (aka 'unsigned char[]') here rocksdb::Range get_range(const int i, uchar buf[]) const; ^

facebook-github-bot commented 1 year ago

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.