[
Date Prev][
Date Next][
Thread Prev][Thread Next][
Date Index][
Thread Index]
[
List Home]
[mosquitto-dev] building git develop trip report
|
System is NetBSD 10 amd64, and dependencies that the mosquitto pkgsrc
package needs are installed.
* cJSON required
I just built (cmake) and got an error that cJSON was not found. That's
easy to install, but README.md says it's optional. Am guessing it is no
longer optional
* addrinfo used without required header
On NetBSD, getaddrinfo documents needing netdb.h. POSIX
https://pubs.opengroup.org/onlinepubs/9799919799/functions/freeaddrinfo.html
says
SYNOPSIS
#include <sys/socket.h>
#include <netdb.h>
void freeaddrinfo(struct addrinfo *ai);
int getaddrinfo(const char *restrict nodename,
const char *restrict servname,
const struct addrinfo *restrict hints,
struct addrinfo **restrict res);
so e.g.
diff --git a/src/http_api.c b/src/http_api.c
index 00f78c84..4b5d96de 100644
--- a/src/http_api.c
+++ b/src/http_api.c
@@ -21,6 +21,7 @@ Contributors:
#include <assert.h>
#include <errno.h>
#include <microhttpd.h>
+#include <netdb.h>
#include <string.h>
#include <sys/stat.h>
* libmicrohttpd
[ 23%] Linking C executable mosquitto
ld: cannot find -lmicrohttpd
*** Error code 1
Looking in README.md, I don't find it mentioned. I'm guessing it's a
new dependency, and just needs to be listed. Installed from pkgsrc and continuing.
* UB invoked via ctypes(3)
/n0/gdt/SOFTWARE/IOT/MQTT/mosquitto/apps/mosquitto_passwd/mosquitto_passwd.c:398:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
398 | if(iscntrl(username[i])){
| ^
almost certainly needs to be casted to unsigned char; it's an error to
pass an argument of type char to ctype functions, because it might be
signed, and when extended to int might be out of range.
* PATH_MAX
[ 27%] Building C object apps/mosquitto_signal/CMakeFiles/mosquitto_signal.dir/signal_unix.c.o
/n0/gdt/SOFTWARE/IOT/MQTT/mosquitto/apps/mosquitto_signal/signal_unix.c: In function ‘signal_all’:
/n0/gdt/SOFTWARE/IOT/MQTT/mosquitto/apps/mosquitto_signal/signal_unix.c:31:15: error: ‘PATH_MAX’ undeclared (first use in this function)
31 | char pathbuf[PATH_MAX+1];
| ^~~~~~~~
I'm not sure where POSIX says this is supposed to be. sys/param.h on
NetBSD. There is a POSIX API to get config like this; it might be more
portable to just use that.
* gmock
[ 41%] Building CXX object test/mock/CMakeFiles/pthread_mock.dir/pthread_mock.cpp.o
In file included from /n0/gdt/SOFTWARE/IOT/MQTT/mosquitto/test/mock/pthread_mock.cpp:1:
/n0/gdt/SOFTWARE/IOT/MQTT/mosquitto/test/mock/pthread_mock.hpp:3:10: fatal error: gmock/gmock.h: No such file or directory
3 | #include <gmock/gmock.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
*** Error code 1
Not documented in README.md
Pausing now, and I realize this is likely develop's first contact with
non-Linux. It would be good for someone to build on FreeBSD and
Illumos.