Skip to main content

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

Hi Fabrizio,

Thank you, you're quite right that there was an int/unsigned int mismatch. I've fixed it now, but it would have never been a real issue happily.

For your other question, the three files you mention are for three separate parts of the project so they will never be linked together.



On Sat, 20 Mar 2021, 13:30 Fabrizio Bertocci, <fabriziobertocci@xxxxxxxxx> wrote:
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?

mosquitto-dev mailing list
To unsubscribe from this list, visit

Back to the top