Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] log__printf

I am trying to rebuild Mosquitto with the Cosmopolitan cross-platform library, and I've noticed that the log__printf is defined in multiple places:
- apps/db_dump/stubs.c
- lib/logging__mosq.c
- src/logging.c

The function signatures are similar but not exactly the same. On a normal build those differences are ignored by the compiler, but in my case they are not, and compilation fails (Linux gcc 9.3.0)

For example when building apps/db_dump, it builds lib/send_disconnect.c that includes first `src/mosquitto_broker_internal.h`, then `lib/logging_mosq.h` and both headers define log__printf, causing compilation problems.
(those problems apparently are ignored when doing a normal build, but they are treated as errors in my build system).
Also, the linker is going to have 3 versions to choose from (although there are rules to let the linker decide which one to pick, is not the most desirable situation).

Build system aside, there should not be 3 global functions with the same name, especially when there are apps (like db_dump) that use pieces from the libs and the broker.

Unfortunately I'm new to the internals of Mosquitto and I am not the right person to decide what's the best thing to do here.

Any advice?


Back to the top