Skip to content

Build when PAHO_USE_SELECT=TRUE is broken in 1.3.16 #1690

Description

@smallSwed

Describe the bug
When building with USE_SELECT defined the compilation fails because of several issues.

  • New function introduced in 1.3.16 use members of the Sockets which are only present when the USE_SELECT is not defined. The function: int isConnectPending(int index)
  • error: conflicting types for ‘Socket_getReadySocket’ the USE_SELECT version of this function missing the interrupted parameter.
  • ...

To Reproduce
Take a library trace as outlined in the README, and/or have a program or describe the steps to reproduce the behavior:

  1. generate cmake with -DPAHO_USE_SELECT=TRUE
  2. build project with cmake --build .
  3. See build errors

Expected behavior
The using PAHO_USE_SELECT=TRUE still builds successfully and usable

Build output

sok@C-W-SOK /tmp/build.paho$ cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_SAMPLES=TRUE -DPAHO_USE_SELECT=TRUE ~/work/git/paho.mqtt.c
-- CMake version: 3.28.3
-- CMake system name: Linux
-- Timestamp is 2026-08-12T12:09:08Z
-- Using OpenSSL with headers at /usr/include
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/build.paho
sok@C-W-SOK /tmp/build.paho$ cmake --build .
[  1%] Building C object src/CMakeFiles/common_obj.dir/MQTTTime.c.o
[  2%] Building C object src/CMakeFiles/common_obj.dir/MQTTProtocolClient.c.o
[  3%] Building C object src/CMakeFiles/common_obj.dir/Clients.c.o
[  3%] Building C object src/CMakeFiles/common_obj.dir/utf-8.c.o
[  4%] Building C object src/CMakeFiles/common_obj.dir/MQTTPacket.c.o
[  5%] Building C object src/CMakeFiles/common_obj.dir/MQTTPacketOut.c.o
[  6%] Building C object src/CMakeFiles/common_obj.dir/Messages.c.o
[  6%] Building C object src/CMakeFiles/common_obj.dir/Tree.c.o
[  7%] Building C object src/CMakeFiles/common_obj.dir/Socket.c.o
/home/sok/work/git/paho.mqtt.c/src/Socket.c: In function ‘isConnectPending’:
/home/sok/work/git/paho.mqtt.c/src/Socket.c:578:32: error: ‘Sockets’ has no member named ‘saved’
  578 |         SOCKET* socket = &mod_s.saved.fds_write[index].fd;
      |                                ^
/home/sok/work/git/paho.mqtt.c/src/Socket.c:583:40: error: ‘Sockets’ has no member named ‘saved’
  583 |                         *socket, (mod_s.saved.fds_write[index].revents & POLLOUT));
      |                                        ^
/home/sok/work/git/paho.mqtt.c/src/Socket.c: At top level:
/home/sok/work/git/paho.mqtt.c/src/Socket.c:600:8: error: conflicting types for ‘Socket_getReadySocket’; have ‘int(int,  int,  pthread_mutex_t *, int *)’
  600 | SOCKET Socket_getReadySocket(int more_work, int timeout, mutex_type mutex, int* rc)
      |        ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/sok/work/git/paho.mqtt.c/src/Socket.c:35:
/home/sok/work/git/paho.mqtt.c/src/Socket.h:144:8: note: previous declaration of ‘Socket_getReadySocket’ with type ‘int(int,  int,  pthread_mutex_t *, int *, int *)’
  144 | SOCKET Socket_getReadySocket(int more_work, int timeout, mutex_type mutex, int* rc, int* interrupted);
      |        ^~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [src/CMakeFiles/common_obj.dir/build.make:188: src/CMakeFiles/common_obj.dir/Socket.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:202: src/CMakeFiles/common_obj.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2

Environment (please complete the following information):

  • OS: Ubuntu
  • Version 24

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions