[MDEV-23910] build warnings and errors on mac os Created: 2020-10-07  Updated: 2021-01-08  Resolved: 2020-12-21

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.5
Fix Version/s: 10.5.9

Type: Bug Priority: Blocker
Reporter: Erica Mann (Inactive) Assignee: Dmitry Shulga
Resolution: Fixed Votes: 1
Labels: None
Environment:

macOS-10.14



 Description   

I am receiving the following warnings (as errors) building MariaDB Server in macOS-10.14 with clang++ (with command / build flags included).

/Applications/Xcode_11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DBTR_CUR_ADAPT -DBTR_CUR_HASH_ADAPT -DCOMPILER_HINTS -DDBUG_TRACE -DHAVE_BZIP2=1 -DHAVE_CONFIG_H -DHAVE_LZ4=1 -DHAVE_LZ4_COMPRESS_DEFAULT=1 -DHAVE_LZMA=1 -DHAVE_NANOSLEEP=1 -DMUTEX_EVENT -DWITH_INNODB_DISALLOW_WRITES -I/Users/runner/work/1/s/mariadb-10.5.5/wsrep-lib/include -I/Users/runner/work/1/s/mariadb-10.5.5/wsrep-lib/wsrep-API/v26 -I/Users/runner/work/1/s/mariadb-10.5.5/builddir/include -I/Users/runner/work/1/s/mariadb-10.5.5/storage/innobase/include -I/Users/runner/work/1/s/mariadb-10.5.5/storage/innobase/handler -I/Users/runner/work/1/s/mariadb-10.5.5/libbinlogevents/include -I/Users/runner/work/1/s/mariadb-10.5.5/tpool -I/Users/runner/work/1/s/mariadb-10.5.5/include -I/Users/runner/work/1/s/mariadb-10.5.5/sql -I/Users/runner/work/1/s/mariadb-10.5.5/builddir/extra/wolfssl -I/Users/runner/work/1/s/mariadb-10.5.5/extra/wolfssl/wolfssl -I/Users/runner/work/1/s/mariadb-10.5.5/extra/wolfssl/wolfssl/wolfssl -Wno-error=enum-conversion -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=incompatible-function-pointer-types -Wno-error=writable-strings -Wno-writable-strings -Wno-write-strings -Wno-error=pointer-sign -Wno-error -fstack-protector --param=ssp-buffer-size=4 -Wconversion -Wno-sign-conversion -g -DENABLED_DEBUG_SYNC -ggdb3 -DSAFE_MUTEX -DSAFEMALLOC -DTRASH_FREED_MEMORY -Wall -Wdeclaration-after-statement -Wextra -Wformat-security -Wno-init-self -Wno-null-conversion -Wno-unused-parameter -Wno-unused-private-field -Woverloaded-virtual -Wnon-virtual-dtor -Wvla -Wwrite-strings -Werror -DUNIV_DEBUG   -DHAVE_OPENSSL -DHAVE_WOLFSSL  -DWOLFSSL_USER_SETTINGS  -fvisibility=hidden -std=gnu++11 -o CMakeFiles/innobase.dir/btr/btr0btr.cc.o -c /Users/runner/work/1/s/mariadb-10.5.5/storage/innobase/btr/btr0btr.cc
2020-10-07T12:49:43.3341180Z In file included from /Users/runner/work/1/s/mariadb-10.5.5/storage/innobase/btr/btr0btr.cc:41:
2020-10-07T12:49:43.3343020Z In file included from /Users/runner/work/1/s/mariadb-10.5.5/storage/innobase/include/trx0trx.h:34:
2020-10-07T12:49:43.3344170Z In file included from /Users/runner/work/1/s/mariadb-10.5.5/storage/innobase/include/trx0xa.h:27:
2020-10-07T12:49:43.3345590Z In file included from /Users/runner/work/1/s/mariadb-10.5.5/sql/handler.h:34:
2020-10-07T12:49:43.3347070Z /Users/runner/work/1/s/mariadb-10.5.5/sql/structs.h:877:14: error: implicit conversion loses integer precision: 'ulong' (aka 'unsigned long') to '__darwin_suseconds_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
 
-----------------------------------------------------------------------------------------------------------------
 
app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DDBUG_TRACE -DHAVE_CONFIG_H -DMYSQL_DYNAMIC_PLUGIN -DWITH_S3_STORAGE_ENGINE -Ds3_EXPORTS -I/Users/runner/work/1/s/10.5/wsrep-lib/include -I/Users/runner/work/1/s/10.5/wsrep-lib/wsrep-API/v26 -I/Users/runner/work/1/s/10.5/builddir/include -I/Users/runner/work/1/s/10.5/builddir/extra/wolfssl -I/Users/runner/work/1/s/10.5/extra/wolfssl/wolfssl -I/Users/runner/work/1/s/10.5/extra/wolfssl/wolfssl/wolfssl -I/Users/runner/work/1/s/10.5/include -I/Users/runner/work/1/s/10.5/sql -I/Users/runner/work/1/s/10.5/storage/maria/libmarias3 -Wno-error=enum-conversion -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=incompatible-function-pointer-types -Wno-error=writable-strings -Wno-writable-strings -Wno-write-strings -Wno-error -Wno-error=pointer-sign -Wno-error=shorten-64-to-32 -fstack-protector --param=ssp-buffer-size=4 -g -DENABLED_DEBUG_SYNC -ggdb3 -DSAFE_MUTEX -DSAFEMALLOC -DTRASH_FREED_MEMORY -Wall -Wdeclaration-after-statement -Wextra -Wformat-security -Wno-init-self -Wno-null-conversion -Wno-unused-parameter -Wno-unused-private-field -Woverloaded-virtual -Wnon-virtual-dtor -Wvla -Wwrite-strings -Werror -fPIC   -fno-common -std=gnu++11 -o CMakeFiles/s3.dir/ha_s3.cc.o -c /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc
2020-10-07T19:53:47.9005030Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9006940Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:33:7: error: 'create' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9007680Z   int create(const char *name, TABLE *table_arg,
2020-10-07T19:53:47.9008050Z       ^
2020-10-07T19:53:47.9008580Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:134:7: note: overridden virtual function is here
2020-10-07T19:53:47.9009190Z   int create(const char *name, TABLE * form, HA_CREATE_INFO * create_info) override;
2020-10-07T19:53:47.9009790Z       ^
2020-10-07T19:53:47.9010300Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9011640Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:35:7: error: 'open' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9015810Z   int open(const char *name, int mode, uint open_flags);
2020-10-07T19:53:47.9016390Z       ^
2020-10-07T19:53:47.9016830Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:82:7: note: overridden virtual function is here
2020-10-07T19:53:47.9017410Z   int open(const char *name, int mode, uint test_if_locked) override;
2020-10-07T19:53:47.9017810Z       ^
2020-10-07T19:53:47.9018200Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9019480Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:36:7: error: 'write_row' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9020180Z   int write_row(const uchar *buf);
2020-10-07T19:53:47.9020510Z       ^
2020-10-07T19:53:47.9020940Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:84:7: note: overridden virtual function is here
2020-10-07T19:53:47.9021460Z   int write_row(const uchar * buf) override;
2020-10-07T19:53:47.9021800Z       ^
2020-10-07T19:53:47.9022160Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9023310Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:37:7: error: 'update_row' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9024770Z   int update_row(const uchar * old_data, const uchar * new_data)
2020-10-07T19:53:47.9025220Z       ^
2020-10-07T19:53:47.9026030Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:85:7: note: overridden virtual function is here
2020-10-07T19:53:47.9026660Z   int update_row(const uchar * old_data, const uchar * new_data) override;
2020-10-07T19:53:47.9027110Z       ^
2020-10-07T19:53:47.9027670Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9028870Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:42:7: error: 'delete_row' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9029630Z   int delete_row(const uchar * buf)
2020-10-07T19:53:47.9030000Z       ^
2020-10-07T19:53:47.9030480Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:86:7: note: overridden virtual function is here
2020-10-07T19:53:47.9031050Z   int delete_row(const uchar * buf) override;
2020-10-07T19:53:47.9031430Z       ^
2020-10-07T19:53:47.9031860Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9033030Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:47:7: error: 'check' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9033780Z   int check(THD * thd, HA_CHECK_OPT * check_opt)
2020-10-07T19:53:47.9034160Z       ^
2020-10-07T19:53:47.9034650Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:144:7: note: overridden virtual function is here
2020-10-07T19:53:47.9035220Z   int check(THD * thd, HA_CHECK_OPT * check_opt) override;
2020-10-07T19:53:47.9035640Z       ^
2020-10-07T19:53:47.9036080Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9037230Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:52:7: error: 'analyze' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9037990Z   int analyze(THD * thd, HA_CHECK_OPT * check_opt)
2020-10-07T19:53:47.9038380Z       ^
2020-10-07T19:53:47.9038870Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:145:7: note: overridden virtual function is here
2020-10-07T19:53:47.9039470Z   int analyze(THD * thd, HA_CHECK_OPT * check_opt) override;
2020-10-07T19:53:47.9039870Z       ^
2020-10-07T19:53:47.9040300Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9041460Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:57:7: error: 'repair' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9042200Z   int repair(THD * thd, HA_CHECK_OPT * check_opt)
2020-10-07T19:53:47.9042590Z       ^
2020-10-07T19:53:47.9043080Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:146:7: note: overridden virtual function is here
2020-10-07T19:53:47.9043650Z   int repair(THD * thd, HA_CHECK_OPT * check_opt) override;
2020-10-07T19:53:47.9044070Z       ^
2020-10-07T19:53:47.9044500Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9045670Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:62:7: error: 'preload_keys' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9046440Z   int preload_keys(THD * thd, HA_CHECK_OPT * check_opt)
2020-10-07T19:53:47.9046850Z       ^
2020-10-07T19:53:47.9047330Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:153:7: note: overridden virtual function is here
2020-10-07T19:53:47.9047920Z   int preload_keys(THD * thd, HA_CHECK_OPT * check_opt) override;
2020-10-07T19:53:47.9048340Z       ^
2020-10-07T19:53:47.9048900Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9050110Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:67:7: error: 'external_lock' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9051060Z   int external_lock(THD * thd, int lock_type);
2020-10-07T19:53:47.9051570Z       ^
2020-10-07T19:53:47.9052060Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:122:7: note: overridden virtual function is here
2020-10-07T19:53:47.9052840Z   int external_lock(THD * thd, int lock_type) override;
2020-10-07T19:53:47.9053260Z       ^
2020-10-07T19:53:47.9053700Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9054870Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:72:8: error: 'drop_table' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9055600Z   void drop_table(const char *name)
2020-10-07T19:53:47.9055980Z        ^
2020-10-07T19:53:47.9056450Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:143:8: note: overridden virtual function is here
2020-10-07T19:53:47.9057030Z   void drop_table(const char *name) override;
2020-10-07T19:53:47.9057410Z        ^
2020-10-07T19:53:47.9057840Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9059120Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:75:7: error: 'delete_table' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9059850Z   int delete_table(const char *name);
2020-10-07T19:53:47.9060210Z       ^
2020-10-07T19:53:47.9060710Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:142:7: note: overridden virtual function is here
2020-10-07T19:53:47.9061250Z   int delete_table(const char *name) override;
2020-10-07T19:53:47.9061640Z       ^
2020-10-07T19:53:47.9062080Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9063240Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:76:7: error: 'rename_table' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9064010Z   int rename_table(const char *from, const char *to);
2020-10-07T19:53:47.9064410Z       ^
2020-10-07T19:53:47.9064890Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:141:7: note: overridden virtual function is here
2020-10-07T19:53:47.9065490Z   int rename_table(const char *from, const char *to) override;
2020-10-07T19:53:47.9065900Z       ^
2020-10-07T19:53:47.9066330Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9067510Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:79:12: error: 's3_open_args' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9068270Z   S3_INFO *s3_open_args() { return open_args; }
2020-10-07T19:53:47.9068670Z            ^
2020-10-07T19:53:47.9069170Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:189:20: note: overridden virtual function is here
2020-10-07T19:53:47.9069730Z   virtual S3_INFO *s3_open_args() { return 0; }
2020-10-07T19:53:47.9070150Z                    ^
2020-10-07T19:53:47.9070610Z In file included from /Users/runner/work/1/s/10.5/storage/maria/ha_s3.cc:70:
2020-10-07T19:53:47.9071780Z /Users/runner/work/1/s/10.5/storage/maria/ha_s3.h:80:8: error: 'register_handler' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2020-10-07T19:53:47.9072530Z   void register_handler(MARIA_HA *file);
2020-10-07T19:53:47.9072910Z        ^
2020-10-07T19:53:47.9073390Z /Users/runner/work/1/s/10.5/storage/maria/ha_maria.h:190:16: note: overridden virtual function is here
2020-10-07T19:53:47.9073980Z   virtual void register_handler(MARIA_HA *file) {}
2020-10-07T19:53:47.9074390Z                ^
2020-10-07T19:53:48.1470730Z 15 errors generated.
2020-10-07T19:53:48.1538590Z make[2]: *** [storage/maria/CMakeFiles/s3.dir/ha_s3.cc.o] Error 1
2020-10-07T19:53:48.1540770Z make[1]: *** [storage/maria/CMakeFiles/s3.dir/all] Error 2



 Comments   
Comment by Seth Shelnutt [ 2020-12-04 ]

The PR that was opened for this issue is now out of sync with the 10.5 branch. I'd like to know what can we do to get the PR accepted? This is blocking our CI for MyTile for OSX using clang 11. Is 10.5 the right branch to base this patch on or do you want it on an older branch? We'd very much like to unblock our 10.5 upgrade. Thanks in advance!

Comment by Sergei Golubchik [ 2020-12-08 ]

It's marked as "Blocker", meaning 10.5.9 will not be released until it's fixed.
Or until it's demoted to a lower priority, but I think it's unlikely in this case.
So, don't worry, it'll be fixed in the next release.

Comment by Dmitry Shulga [ 2020-12-21 ]

Both compilation issues were already fixed.

The error report about loosing integer precision on implicit conversion

2020-10-07T12:49:43.3347070Z /Users/runner/work/1/s/mariadb-10.5.5/sql/structs.h:877:14: error: implicit conversion loses integer precision: 'ulong' (aka 'unsigned long') to '__darwin_suseconds_t' (aka 'int') [-Werror,-Wshorten-64-to-32]

was fixed by a commit for the bug report MDEV-24115 (Fix -Wconversion in Timeval::Timeval() on Mac OS X)

Compiler errors about missed the 'override' keyword in some methods of the class ha_s3 were fixed
on Nov 2 2020 by the commit 440d4b282dd4992d64abdd6289859598db7e5f75 (Fix clang -Winconsistent-missing-override)

So, this bug report can be closed.

I checked both the actual version of branches 10.5 and 10.6 - above mentioned bugs are not reproduced any more.

Comment by Seth Shelnutt [ 2021-01-08 ]

@shulga Thanks for for confirming and test that everything is fixed! We are excited for the next release

Generated at Thu Feb 08 09:25:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.