Bug #85984 Clang build warnings in LDAP auth plugin
Submitted: 18 Apr 2017 13:17 Modified: 15 May 2017 15:43
Reporter: Jon Olav Hauglid Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.2 OS:Any
Assigned to: CPU Architecture:Any

[18 Apr 2017 13:17] Jon Olav Hauglid
Description:
Lots of build warnings when building the LDAP auth plugin with Clang (e.g. on MacOS).
See http://pb2.no.oracle.com/html/logviewer.html?f=23130372.log&b=11103859

/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.h:189:7: warning: 'Ldap_authentication' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]

/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:31:16: warning: address of array 'g_option.m_user_search_attr' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_user_search_attr) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:35:16: warning: address of array 'g_option.m_group_search_attr' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_group_search_attr) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:38:16: warning: address of array 'g_option.m_bind_root_dn' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_bind_root_dn) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:41:16: warning: address of array 'g_option.m_bind_root_pwd' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_bind_root_pwd) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:44:16: warning: address of array 'g_option.m_bind_base_dn' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_bind_base_dn) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:47:16: warning: address of array 'g_option.m_auth_method' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_auth_method) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:50:16: warning: address of array 'g_option.m_server_host' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_server_host) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:469:80: warning: missing field 'm_volatility' initializer [-Wmissing-field-initializers]
                                        {&m_pool_key, "LOCK_connection_pool", 0},
                                                                               ^
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:510:16: warning: address of array 'g_option.m_server_host' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_server_host) {
  ~~  ~~~~~~~~~^~~~~~~~~~~~~
/Volumes/hd2/pb2/build/sb_0-23129430-1492508243.71/mysqlcom-pro-8.0.2-dmr/plugin/authentication_ldap/auth_ldap.cc:517:16: warning: address of array 'g_option.m_ca_path' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (g_option.m_ca_path) {
  ~~  ~~~~~~~~~^~~~~~~~~

etc.

How to repeat:
Check MacOS build logs.
[15 May 2017 15:43] Paul DuBois
Posted by developer:
 
Fixed in 8.0.2.

Bug affects no released version. No changelog entry needed.