Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-1265

strerror_r calls result in compiler warnings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.2.0
    • Component/s: build, Core
    • Labels:
      None
    • Environment:
      Alpine Linux
    • Sprint:
      2017-39

      Description

      Hi, I am trying to compile MaxScale on Alpine Linux. During building I get the following errors (excerpt):

      /root/MaxScale-maxscale-2.0.5/server/core/buffer.c:738:9: note: in expansion of macro 'MXS_ERROR'
      MXS_ERROR("Memory allocation failed due to %s.",
      ^~~~~~~~~
      /root/MaxScale-maxscale-2.0.5/server/core/buffer.c: In function 'gwbuf_add_property':
      /root/MaxScale-maxscale-2.0.5/server/core/buffer.c:822:19: error: format '%s' expects argument of type 'char *', but argument 6 has type 'int' [-Werror=format=]
      MXS_ERROR("Memory allocation failed due to %s.",
      ^
      /root/MaxScale-maxscale-2.0.5/server/include/log_manager.h:112:61: note: in definition of macro 'MXS_LOG_MESSAGE'
      mxs_log_message(priority, _FILE, __LINE, __func, format, ##VA_ARGS_)
      ^~~~~~
      /root/MaxScale-maxscale-2.0.5/server/core/buffer.c:822:9: note: in expansion of macro 'MXS_ERROR'
      MXS_ERROR("Memory allocation failed due to %s.",
      ^~~~~~~~~
      cc1: all warnings being treated as errors
      make[2]: *** [server/core/CMakeFiles/maxscale-common.dir/build.make:111: server/core/CMakeFiles/maxscale-common.dir/buffer.c.o] Error 1

      I am baffled. strerror_r returns an int, and the format string uses %s. What am I missing here?

        Attachments

          Activity

            People

            Assignee:
            markus makela markus makela
            Reporter:
            raarts Ron Arts
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: