Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-8187

Incompatible callback function pointer casts fail to build on GCC 8

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: qpid-cpp-1.38.0
    • Fix Version/s: qpid-cpp-1.39.0
    • Component/s: C++ Broker
    • Labels:
      None
    • Environment:

      Gentoo x64, GCC 8.1

      Description

      [ 22%] Building CXX object src/CMakeFiles/qpidcommon.dir/qpid/sys/epoll/EpollPoller.cpp.o
      /home/chrisr/projects/qpid/qpid-cpp/source/src/qpid/SaslFactory.cpp: In constructor ‘qpid::CyrusSasl::CyrusSasl(const string&, const string&, const string&, const string&, int, int, bool)’:
      /home/chrisr/projects/qpid/qpid-cpp/source/src/qpid/SaslFactory.cpp:215:46: error: cast between incompatible function types from ‘int (void*, int, const char*, unsigned int)’ to ‘int ()’ [-Werror=cast-function-type]
      callbacks[i].proc = (CallbackProc*) &getUserFromSettings;
      ^~~~~~~~~~~~~~~~~~~
      /home/chrisr/projects/qpid/qpid-cpp/source/src/qpid/SaslFactory.cpp:223:50: error: cast between incompatible function types from ‘int (sasl_conn_t*, void*, int, sasl_secret_t**)’
      Unknown macro: {aka ‘int (sasl_conn*, void*, int, sasl_secret**)’}
      to ‘int ()’ [-Werror=cast-function-type]
      callbacks[i].proc = (CallbackProc*) &getPasswordFromSettings;
      ^~~~~~~~~~~~~~~~~~~~~~ 

      Given the constrains of the SASL library interface, the only obvious solution for this I can think of is to add "-Wno-error=cast-function-type" to the compiler settings.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                justi9 Justin Ross
                Reporter:
                crichardson Chris Richardson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: