← Back to team overview

maria-developers team mailing list archive

Re: db1fbafbead: MDEV-23935: Fix warnings generated during compilation of plugin/auth_pam/testing/pam_mariadb_mtr.c on MacOS

 

Hi, Dmitry!

ok to push

On Oct 19, Dmitry Shulga wrote:
> revision-id: db1fbafbead (mariadb-10.4.11-420-gdb1fbafbead)
> parent(s): c2ac0ce1f02
> author: Dmitry Shulga <dmitry.shulga@xxxxxxxxxxx>
> committer: Dmitry Shulga <dmitry.shulga@xxxxxxxxxxx>
> timestamp: 2020-10-11 21:51:45 +0700
> message:
> 
> MDEV-23935: Fix warnings generated during compilation of plugin/auth_pam/testing/pam_mariadb_mtr.c on MacOS
> 
> During build server 10.4 on MacOS warnings like the following one
> are generated on compiling the file plugin/auth_pam/testing/pam_mariadb_mtr.c
> 
> server-10.4/plugin/auth_pam/testing/pam_mariadb_mtr.c:25:22: error:
> initializing 'char *' with an expression of type 'const char [23]'
> discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
> { PAM_TEXT_INFO, "Challenge input first." }
> 
> The reason of the warnings is that the data member pam_message::msg is declared
> as 'char *' on MacOS but initializer of the data member is 'const char *'.
> 
> To eliminate warnings the compiler option
>   -Wno-incompatible-pointer-types-discards-qualifiers
> has been added to the compiler flags used for compiling the file
> pam_mariadb_mtr.c.
> 
> ---
>  plugin/auth_pam/testing/CMakeLists.txt | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/plugin/auth_pam/testing/CMakeLists.txt b/plugin/auth_pam/testing/CMakeLists.txt
> index 889cb524402..c8d2e3cbb97 100644
> --- a/plugin/auth_pam/testing/CMakeLists.txt
> +++ b/plugin/auth_pam/testing/CMakeLists.txt
> @@ -4,6 +4,12 @@ ADD_LIBRARY(pam_mariadb_mtr MODULE pam_mariadb_mtr.c)
>  SET_TARGET_PROPERTIES (pam_mariadb_mtr PROPERTIES PREFIX "")
>  TARGET_LINK_LIBRARIES(pam_mariadb_mtr pam)
>  
> +IF(APPLE)
> +  SET_SOURCE_FILES_PROPERTIES(
> +    pam_mariadb_mtr.c
> +    PROPERTY COMPILE_FLAGS "-Wno-incompatible-pointer-types-discards-qualifiers")
> +ENDIF()
> +
>  SET(dest DESTINATION "${INSTALL_MYSQLTESTDIR}/suite/plugins/pam" COMPONENT Test)
>  INSTALL(TARGETS pam_mariadb_mtr ${dest})
>  INSTALL(FILES mariadb_mtr.conf RENAME mariadb_mtr ${dest})
> 
Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx