[MDEV-31528] Fix warnings generated during compilation of mysys_ssl/openssl.c on MacOS Created: 2023-06-22  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Dmitry Shulga
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The fix for MDEV-23925 was reverted with the comment

Revert "MDEV-23925: Fixed warnings generated during compilation of mysys_ssl/openssl.c on MacOS"
 
This reverts commit a1b6691f93e50ad4a8a53dbf89ba578d6a64b2cb.
 
because #ifdef checks the symbol defined in ssl_compat.h,
so #include <ssl_compat.h> cannot be inside #ifdef

So, needs to be fixed again. Original description below


When server is built on MacOS the following warnings are produced by compiler on processing the file mysys_ssl/openssl.c

In case MariaDB serer is build with -DCMAKE_BUILD_TYPE=Debug it results in build error.
In other words, debug build can't be finished successfully on MacOS.

In file included from /Users/shulga/projects/mariadb/server-10.2-MDEV-23564/mysys_ssl/openssl.c:33:
In file included from /usr/local/include/openssl/evp.h:16:
In file included from /usr/local/include/openssl/bio.h:20:
/usr/local/include/openssl/crypto.h:206:10: warning: 'CRYPTO_cleanup_all_ex_data' macro redefined [-Wmacro-redefined]
# define CRYPTO_cleanup_all_ex_data() while(0) continue
         ^
/Users/shulga/projects/mariadb/server-10.2-MDEV-23564/include/ssl_compat.h:46:9: note: previous definition is here
#define CRYPTO_cleanup_all_ex_data()
        ^
In file included from /Users/shulga/projects/mariadb/server-10.2-MDEV-23564/mysys_ssl/openssl.c:33:
/usr/local/include/openssl/evp.h:501:10: warning: 'EVP_MD_CTX_init' macro redefined [-Wmacro-redefined]
# define EVP_MD_CTX_init(ctx)    EVP_MD_CTX_reset((ctx))
         ^
/Users/shulga/projects/mariadb/server-10.2-MDEV-23564/include/ssl_compat.h:33:9: note: previous definition is here
#define EVP_MD_CTX_init(X) do { bzero((X), EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0)
        ^
In file included from /Users/shulga/projects/mariadb/server-10.2-MDEV-23564/mysys_ssl/openssl.c:33:
/usr/local/include/openssl/evp.h:627:11: warning: 'EVP_CIPHER_CTX_init' macro redefined [-Wmacro-redefined]
#  define EVP_CIPHER_CTX_init(c)      EVP_CIPHER_CTX_reset(c)
          ^
/Users/shulga/projects/mariadb/server-10.2-MDEV-23564/include/ssl_compat.h:35:9: note: previous definition is here
#define EVP_CIPHER_CTX_init(X) do { bzero((X), EVP_CIPHER_CTX_SIZE); EVP_CIPHER_CTX_reset(X); } while(0)
        ^
In file included from /Users/shulga/projects/mariadb/server-10.2-MDEV-23564/mysys_ssl/openssl.c:33:
/usr/local/include/openssl/evp.h:866:11: warning: 'EVP_cleanup' macro redefined [-Wmacro-redefined]
#  define EVP_cleanup() while(0) continue
          ^
/Users/shulga/projects/mariadb/server-10.2-MDEV-23564/include/ssl_compat.h:44:9: note: previous definition is here
#define EVP_cleanup()
        ^
4 warnings generated.


Generated at Thu Feb 08 10:24:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.