From 84d12cfacf8ddd857a09435f3d982ab6250d250c Mon Sep 17 00:00:00 2001 From: Nicholas Vinson Date: Wed, 15 Jun 2022 07:35:28 -0400 Subject: 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 Signed-off-by: Florian Westphal --- src/expr/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/expr/log.c') diff --git a/src/expr/log.c b/src/expr/log.c index 86db548..180d839 100644 --- a/src/expr/log.c +++ b/src/expr/log.c @@ -253,5 +253,5 @@ struct expr_ops expr_ops_log = { .get = nftnl_expr_log_get, .parse = nftnl_expr_log_parse, .build = nftnl_expr_log_build, - .snprintf = nftnl_expr_log_snprintf, + .output = nftnl_expr_log_snprintf, }; -- cgit v1.2.3