From patchwork Thu Dec 19 21:58:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1213724 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TGycDuIP"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47f5Q96JFWz9sPL for ; Fri, 20 Dec 2019 08:59:45 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0zz1bZZgq2a6Q8o0Xva7diz4xNdfp9XPwOqhuCXwCvY=; b=TGycDuIPf46wFB 0NKY0BtLefRNTKTxRD8IotlPeQi6IYIMWjhRmIrQh6WFHH/DuA4X1pauIGC8WLLzqRpHth8VcI1Sp abZxlh5UC76QYqgdNUsuit2L9YnE0N+OUlh1FJccBzQ3UIcl8tFKjT+l/gI4CZuQyUvcEypWrC224 lRa5pJecrqkCjUwBulO0CaGiNmVOxquUnZRfr3ypWzxuF5F5L5AVlQJ2VHd/uSmlDRpLvuoyF5Srg 6R68o5d53Mlk58YGwfcjKeVUD1PqYZBE7IoX4QqY1PDE0pytPEXQTQaI/ZnvLM5rObxrTXpnD9OFS s45V7QYo4DQxKAwGQzPw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ii3pZ-0001lZ-9i; Thu, 19 Dec 2019 21:59:37 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ii3om-0000r0-KH for openwrt-devel@lists.openwrt.org; Thu, 19 Dec 2019 21:58:51 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 766F04B43; Thu, 19 Dec 2019 22:58:46 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id abf7970f; Thu, 19 Dec 2019 22:58:32 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Thu, 19 Dec 2019 22:58:18 +0100 Message-Id: <20191219215836.21773-3-ynezz@true.cz> In-Reply-To: <20191219215836.21773-1-ynezz@true.cz> References: <20191219215836.21773-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191219_135848_831623_29A8BE34 X-CRM114-Status: UNSURE ( 6.83 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH libubox 02/20] blobmsg/ulog: fix format string compiler warnings X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Fixes following compiler warnings: blobmsg.c:242:39: error: format string is not a string literal [-Werror,-Wformat-nonliteral] blobmsg.c:248:23: error: format string is not a string literal [-Werror,-Wformat-nonliteral] ulog.c:100:18: error: format string is not a string literal [-Werror,-Wformat-nonliteral] ulog.c:112:16: error: format string is not a string literal [-Werror,-Wformat-nonliteral] ulog.c:117:20: error: format string is not a string literal [-Werror,-Wformat-nonliteral] Signed-off-by: Petr Štetiar --- blobmsg.c | 8 ++++---- ulog.c | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/blobmsg.c b/blobmsg.c index a860483bfa7e..97e0c20575ff 100644 --- a/blobmsg.c +++ b/blobmsg.c @@ -230,8 +230,8 @@ blobmsg_open_nested(struct blob_buf *buf, const char *name, bool array) return (void *)offset; } -int -blobmsg_vprintf(struct blob_buf *buf, const char *name, const char *format, va_list arg) +__attribute__((format(printf, 3, 0))) +int blobmsg_vprintf(struct blob_buf *buf, const char *name, const char *format, va_list arg) { va_list arg2; char cbuf; @@ -251,8 +251,8 @@ blobmsg_vprintf(struct blob_buf *buf, const char *name, const char *format, va_l return ret; } -int -blobmsg_printf(struct blob_buf *buf, const char *name, const char *format, ...) +__attribute__((format(printf, 3, 4))) +int blobmsg_printf(struct blob_buf *buf, const char *name, const char *format, ...) { va_list ap; int ret; diff --git a/ulog.c b/ulog.c index b7300e720d21..05946a0c3521 100644 --- a/ulog.c +++ b/ulog.c @@ -87,6 +87,7 @@ static void ulog_defaults(void) _ulog_initialized = 1; } +__attribute__((format(printf, 2, 0))) static void ulog_kmsg(int priority, const char *fmt, va_list ap) { FILE *kmsg; @@ -102,6 +103,7 @@ static void ulog_kmsg(int priority, const char *fmt, va_list ap) } } +__attribute__((format(printf, 2, 0))) static void ulog_stdio(int priority, const char *fmt, va_list ap) { FILE *out = stderr; @@ -112,6 +114,7 @@ static void ulog_stdio(int priority, const char *fmt, va_list ap) vfprintf(out, fmt, ap); } +__attribute__((format(printf, 2, 0))) static void ulog_syslog(int priority, const char *fmt, va_list ap) { vsyslog(priority, fmt, ap);