Bug #82922 compilation warnings (errors in maintainer mode) with gcc 6 on freebsd
Description:
...
[ 6%] Building CXX object mysys/CMakeFiles/mysys.dir/my_thr_init.cc.o
cd ./vd/build/mysql-trunk/mysys && /usr/local/bin/g++6 -DHAVE_CONFIG_H -DHAVE_LIBEVENT1 -DRAPIDJSON_NO_SIZETYPEDEFINE -D_USE_MATH_DEFINES -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I./vd/build/mysql-trunk/include -I/usr/home/vd/mysql-trunk/extra/rapidjson/include -I./vd/mysql-trunk/sql/histograms -I./vd/build/mysql-trunk/libbinlogevents/include -I./vd/mysql-trunk/libbinlogevents/export -I./vd/mysql-trunk/zlib -I./vd/mysql-trunk/include -I./vd/mysql-trunk/mysys -Wall -Wextra -Wformat-security -Wvla -Wmissing-format-attribute -Wundef -Woverloaded-virtual -Wno-unused-parameter -Wlogical-op -Werror -fPIC -g -fno-omit-frame-pointer -fno-strict-aliasing -std=c++11 -DENABLED_DEBUG_SYNC -DSAFE_MUTEX -o CMakeFiles/mysys.dir/my_thr_init.cc.o -c ./vd/mysql-trunk/mysys/my_thr_init.cc
./vd/mysql-trunk/mysys/my_thr_init.cc: In function 'void my_thread_global_end()':
./vd/mysql-trunk/mysys/my_thr_init.cc:235:28: error: logical 'or' of equal expressions [-Werror=logical-op]
if (error == ETIMEDOUT || error == ETIME)
cc1plus: all warnings being treated as errors
...
This is because we have:
include/my_thread.h:
#ifndef ETIME
#define ETIME ETIMEDOUT /* For FreeBSD */
#endif
and in lots of places in the code:
if (error == ETIMEDOUT || error == ETIME)
which ends up as
if (error == ETIMEDOUT || error == ETIMEDOUT)
How to repeat:
$ gcc6 --version
gcc6 (FreeBSD Ports Collection) 6.2.0
$ uname
FreeBSD
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders. It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: ... [ 6%] Building CXX object mysys/CMakeFiles/mysys.dir/my_thr_init.cc.o cd ./vd/build/mysql-trunk/mysys && /usr/local/bin/g++6 -DHAVE_CONFIG_H -DHAVE_LIBEVENT1 -DRAPIDJSON_NO_SIZETYPEDEFINE -D_USE_MATH_DEFINES -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I./vd/build/mysql-trunk/include -I/usr/home/vd/mysql-trunk/extra/rapidjson/include -I./vd/mysql-trunk/sql/histograms -I./vd/build/mysql-trunk/libbinlogevents/include -I./vd/mysql-trunk/libbinlogevents/export -I./vd/mysql-trunk/zlib -I./vd/mysql-trunk/include -I./vd/mysql-trunk/mysys -Wall -Wextra -Wformat-security -Wvla -Wmissing-format-attribute -Wundef -Woverloaded-virtual -Wno-unused-parameter -Wlogical-op -Werror -fPIC -g -fno-omit-frame-pointer -fno-strict-aliasing -std=c++11 -DENABLED_DEBUG_SYNC -DSAFE_MUTEX -o CMakeFiles/mysys.dir/my_thr_init.cc.o -c ./vd/mysql-trunk/mysys/my_thr_init.cc ./vd/mysql-trunk/mysys/my_thr_init.cc: In function 'void my_thread_global_end()': ./vd/mysql-trunk/mysys/my_thr_init.cc:235:28: error: logical 'or' of equal expressions [-Werror=logical-op] if (error == ETIMEDOUT || error == ETIME) cc1plus: all warnings being treated as errors ... This is because we have: include/my_thread.h: #ifndef ETIME #define ETIME ETIMEDOUT /* For FreeBSD */ #endif and in lots of places in the code: if (error == ETIMEDOUT || error == ETIME) which ends up as if (error == ETIMEDOUT || error == ETIMEDOUT) How to repeat: $ gcc6 --version gcc6 (FreeBSD Ports Collection) 6.2.0 $ uname FreeBSD