summaryrefslogtreecommitdiffstats
path: root/src/object.c
diff options
context:
space:
mode:
authorNicholas Vinson <nvinson234@gmail.com>2022-06-15 07:35:28 -0400
committerFlorian Westphal <fw@strlen.de>2022-06-15 13:54:44 +0200
commit84d12cfacf8ddd857a09435f3d982ab6250d250c (patch)
tree1bf88d72d633faf94e80e04e0f93598ce6f4110a /src/object.c
parentf6575131e60ab10f131ea3ff36f69af2b6c3f614 (diff)
build: fix clang+glibc snprintf substitution error
When building with clang and glibc and -D_FORTIFY_SOURCE=2 is passed to clang, the snprintf member of the expr_ops and obj_ops structures will be incorrectly replaced with __builtin_snprintf_chk() which results in "error: no member named '__builtin___snprintf_chk'" errors at build time. This patch changes the member name from 'snprintf' to 'output' to prevent the replacement. This bug can be emulated using GCC by undefining the __va_arg_pack macro before stdio.h is included. This patch is based on the notes provided in https://bugs.gentoo.org/807766. Signed-off-by: Nicholas Vinson <nvinson234@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/object.c b/src/object.c
index 46e208b..232b97a 100644
--- a/src/object.c
+++ b/src/object.c
@@ -396,7 +396,7 @@ static int nftnl_obj_snprintf_dflt(char *buf, size_t remain,
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
if (obj->ops) {
- ret = obj->ops->snprintf(buf + offset, remain, flags, obj);
+ ret = obj->ops->output(buf + offset, remain, flags, obj);
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
}
ret = snprintf(buf + offset, remain, "]");