Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24577

Fix warnings generated during compilation of plugin/auth_pam/testing/pam_mariadb_mtr.c on FreeBSD

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.15, 10.4.17
    • Fix Version/s: 10.4.18, 10.5.9, 10.6.0
    • Component/s: Compiling
    • Labels:
      None
    • Environment:
      FreeBSD clang version 10.0.0 (git@github.com:llvm/llvm-project.git llvmorg-10.0.0-0-gd32170dbd5b)
      Target: x86_64-unknown-freebsd11.4

      Description

      This is the same bug as MDEV-23935 (OS X) but for FreeBSD. I cloned it thus the "fix version" is invalid, sorry.

      The fix was ifdef apple so maybe we need something like ifdef llvm/clang?

      copy of original report:
      following warnings 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." },
                           ^~~~~~~~~~~~~~~~~~~~~~~~
      server-10.4/plugin/auth_pam/testing/pam_mariadb_mtr.c:26:28: error:
            initializing 'char *' with an expression of type 'const char [7]' discards qualifiers
            [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
          { PAM_PROMPT_ECHO_OFF, "Enter:" },
                                 ^~~~~~~~
      server-10.4/plugin/auth_pam/testing/pam_mariadb_mtr.c:27:22: error:
            initializing 'char *' with an expression of type 'const char [23]' discards qualifiers
            [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
          { PAM_ERROR_MSG, "Now, the magic number!" }
                           ^~~~~~~~~~~~~~~~~~~~~~~~
      server-10.4/plugin/auth_pam/testing/pam_mariadb_mtr.c:49:16: error:
            assigning to 'char *' from 'const char [5]' discards qualifiers
            [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
          msg[0].msg = "PIN:";
                     ^ ~~~~~~
      

      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 10.4 and higher.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shulga Dmitry Shulga
              Reporter:
              marcin.gryszkalis Marcin Gryszkalis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration