summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-07 15:10:58 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-07 21:05:26 +0200
commit6695c200bd5f0cbe65647fcdafa2f1dbed4b6a64 (patch)
tree361c86f4e25c2041772afad10df10b260176ce74 /meson.build
parent881a62debbac022046f350be5c3c7e909189a7e7 (diff)
downloadsystemd-6695c200bd5f0cbe65647fcdafa2f1dbed4b6a64.tar.gz
shared/utmp-wtmp: silence gcc warning about strncpy truncation
Unfortunately the warning must be known, or otherwise the pragma generates a warning or an error. So let's do a meson check for it. Is it worth doing this to silence the warning? I think so, because apparently the warning was already emitted by gcc-8.1, and with the recent push in gcc to catch more such cases, we'll most likely only get more of those.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build3
1 files changed, 3 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 24ef643d44..b5d06e4226 100644
--- a/meson.build
+++ b/meson.build
@@ -411,11 +411,14 @@ endif
cpp = ' '.join(cc.cmd_array()) + ' -E'
+has_wstringop_truncation = cc.has_argument('-Wstringop-truncation')
+
#####################################################################
# compilation result tests
conf.set('_GNU_SOURCE', true)
conf.set('__SANE_USERSPACE_TYPES__', true)
+conf.set10('HAVE_WSTRINGOP_TRUNCATION', has_wstringop_truncation)
conf.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
conf.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))