Compilation error: [-Werror=stringop-overflow=]
Valentin V. Bartenev
vbart at nginx.com
Wed Dec 8 21:37:14 UTC 2021
On Wednesday, 8 December 2021 12:16:18 MSK Alejandro Colomar (man-pages) wrote:
[..]
> > The error doesn't make much sense, since this file doesn't seem to be
> > calling sigsetjmp(3) nor using 200 bytes of any buffer, so it looks like
> > either a glibc bug, or a compiler bug.
> >
> > Did you see this bug before?
> >
I've installed Debian Sid just to reproduce it.
It seems the issue is caused by mismatch between __sigsetjmp() prototypes
in <setjmp.h> and <pthread.h> system headers. So, changing their order
in Unit includes resolved the issue for me:
diff --git a/src/nxt_unix.h b/src/nxt_unix.h
--- a/src/nxt_unix.h
+++ b/src/nxt_unix.h
@@ -153,6 +153,7 @@
#include <poll.h>
#include <pwd.h>
#include <semaphore.h>
+#include <pthread.h>
#include <setjmp.h>
#include <sched.h>
#include <signal.h>
@@ -184,7 +185,6 @@
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
-#include <pthread.h>
#if (NXT_HAVE_EPOLL)
#include <sys/epoll.h>
But that doesn't look like a Unit issue, it just indicates broken toolchain
in Debian Sid. So, I wouldn't recommend using unstable distribution for
development, as you will end up spending time on fighting various strange
and unrelated issues with the system rather than with the project.
Personally I prefer to use Gentoo. It allows good balance between stability
and cutting edge.
wbr, Valentin V. Bartenev
More information about the unit
mailing list