<HTML><BODY><p>As it is mentioned in #4515, strncpy() warning needs<br>to be suppressed so it does not fail the build with<br>-DENABLE_WERROR=ON.</p><p>Closes: #4515<br>---<br> src/systemd.c | 2 ++<br> src/systemd.h | 13 +++++++++++++<br> 2 files changed, 15 insertions(+)</p><p>diff --git a/src/systemd.c b/src/systemd.c<br>index 6686c3ce0..8e81b274c 100644<br>--- a/src/systemd.c<br>+++ b/src/systemd.c<br>@@ -117,7 +117,9 @@ int systemd_notify(const char *message) {<br> .sun_family = AF_UNIX,<br> };<br> <br>+ WSTRINGOP_TRUNC_OFF<br> strncpy(sa.sun_path, sd_unix_path, sizeof(sa.sun_path));<br>+ WSTRINGOP_TRUNC_ON<br> if (sa.sun_path[0] == '@')<br> sa.sun_path[0] = '\0';<br> <br>diff --git a/src/systemd.h b/src/systemd.h<br>index 861a9af35..854405847 100644<br>--- a/src/systemd.h<br>+++ b/src/systemd.h<br>@@ -107,4 +107,17 @@ systemd_snotify(const char *format, ...);<br> } /* extern "C" */<br> #endif /* defined(__cplusplus) */<br> <br>+#ifdef __GNUC__<br>+#if __GNUC__ >= 8<br>+#define WSTRINGOP_TRUNC_OFF \<br>+ _Pragma ("GCC diagnostic push") \<br>+ _Pragma ("GCC diagnostic ignored \"-Wstringop-truncation\"")<br>+#define WSTRINGOP_TRUNC_ON \<br>+ _Pragma ("GCC diagnostic pop")<br>+#endif<br>+#else<br>+#define WSTRINGOP_TRUNC_OFF<br>+#define WSTRINGOP_TRUNC_ON<br>+#endif<br>+<br> #endif /* TARANTOOL_SYSTEMD_H_INCLUDED */<br>-- <br>2.24.0</p></BODY></HTML>