Skip to content
Permalink
Browse files
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.
  • Loading branch information
dmitryshulga committed Oct 22, 2020
1 parent 709ba7d commit 77c0079
Showing 1 changed file with 6 additions and 0 deletions.
@@ -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})

0 comments on commit 77c0079

Please sign in to comment.