From patchwork Thu Mar 4 12:48:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 392845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F31C8C43381 for ; Thu, 4 Mar 2021 12:53:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C28B964F2B for ; Thu, 4 Mar 2021 12:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237637AbhCDMxI (ORCPT ); Thu, 4 Mar 2021 07:53:08 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:60967 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237581AbhCDMwu (ORCPT ); Thu, 4 Mar 2021 07:52:50 -0500 Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 1EFBA3BAE16 for ; Thu, 4 Mar 2021 12:50:03 +0000 (UTC) X-Originating-IP: 78.199.60.242 Received: from classic.redhat.com (unknown [78.199.60.242]) (Authenticated sender: hadess@hadess.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id BF756FF805 for ; Thu, 4 Mar 2021 12:48:51 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Subject: [PATCH 1/3] build: Add warnings for non-literal strings Date: Thu, 4 Mar 2021 13:48:49 +0100 Message-Id: <20210304124851.219154-1-hadess@hadess.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 529848357..6ae34b8ae 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -21,7 +21,7 @@ AC_DEFUN([COMPILER_FLAGS], [ with_cflags="$with_cflags -Wredundant-decls" with_cflags="$with_cflags -Wcast-align" with_cflags="$with_cflags -Wswitch-enum" - with_cflags="$with_cflags -Wformat -Wformat-security" + with_cflags="$with_cflags -Wformat -Wformat-security -Wformat-nonliteral" with_cflags="$with_cflags -DG_DISABLE_DEPRECATED" with_cflags="$with_cflags -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_28" with_cflags="$with_cflags -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32" From patchwork Thu Mar 4 12:48:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 393671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02EC7C4332D for ; Thu, 4 Mar 2021 12:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8D2264F3D for ; Thu, 4 Mar 2021 12:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237417AbhCDMxG (ORCPT ); Thu, 4 Mar 2021 07:53:06 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:34451 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237621AbhCDMwu (ORCPT ); Thu, 4 Mar 2021 07:52:50 -0500 Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 4390B3BAE17 for ; Thu, 4 Mar 2021 12:50:03 +0000 (UTC) X-Originating-IP: 78.199.60.242 Received: from classic.redhat.com (unknown [78.199.60.242]) (Authenticated sender: hadess@hadess.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 242DCFF809 for ; Thu, 4 Mar 2021 12:48:51 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Subject: [PATCH 2/3] obex: Work-around compilation failure Date: Thu, 4 Mar 2021 13:48:50 +0100 Message-Id: <20210304124851.219154-2-hadess@hadess.net> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210304124851.219154-1-hadess@hadess.net> References: <20210304124851.219154-1-hadess@hadess.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org obexd/plugins/bluetooth.c: In function 'register_profile': obexd/plugins/bluetooth.c:310:7: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] profile->driver->port); ^~~~~~~ obexd/plugins/bluetooth.c:314:7: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] profile->driver->name); ^~~~~~~ --- obexd/plugins/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c index d232d3fd5..66f432d66 100644 --- a/obexd/plugins/bluetooth.c +++ b/obexd/plugins/bluetooth.c @@ -258,6 +258,9 @@ static int register_profile(struct bluetooth_profile *profile) &opt); g_dbus_dict_append_entry(&opt, "AutoConnect", DBUS_TYPE_BOOLEAN, &auto_connect); + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" if (profile->driver->record) { if (profile->driver->port != 0) xml = g_markup_printf_escaped(profile->driver->record, @@ -268,6 +271,7 @@ static int register_profile(struct bluetooth_profile *profile) xml = g_markup_printf_escaped(profile->driver->record, profile->driver->channel, profile->driver->name); +#pragma GCC diagnostic pop g_dbus_dict_append_entry(&opt, "ServiceRecord", DBUS_TYPE_STRING, &xml); g_free(xml); From patchwork Thu Mar 4 12:48:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bastien Nocera X-Patchwork-Id: 393672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4684C433E6 for ; Thu, 4 Mar 2021 12:53:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 904F364F37 for ; Thu, 4 Mar 2021 12:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237581AbhCDMxI (ORCPT ); Thu, 4 Mar 2021 07:53:08 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:56987 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237757AbhCDMxA (ORCPT ); Thu, 4 Mar 2021 07:53:00 -0500 Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow2.mail.gandi.net (Postfix) with ESMTP id AD54B3BAE18 for ; Thu, 4 Mar 2021 12:50:03 +0000 (UTC) X-Originating-IP: 78.199.60.242 Received: from classic.redhat.com (unknown [78.199.60.242]) (Authenticated sender: hadess@hadess.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 6D1F6FF80C for ; Thu, 4 Mar 2021 12:48:52 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Subject: [PATCH 3/3] tools/mesh-cfglient: Work-around compilation failure Date: Thu, 4 Mar 2021 13:48:51 +0100 Message-Id: <20210304124851.219154-3-hadess@hadess.net> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210304124851.219154-1-hadess@hadess.net> References: <20210304124851.219154-1-hadess@hadess.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org tools/mesh-cfgclient.c: In function ‘disp_numeric_call’: tools/mesh-cfgclient.c:543:10: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] 543 | n); | ^ --- tools/mesh-cfgclient.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/mesh-cfgclient.c b/tools/mesh-cfgclient.c index 1eeed2a1a..ab5026e9b 100644 --- a/tools/mesh-cfgclient.c +++ b/tools/mesh-cfgclient.c @@ -530,8 +530,11 @@ static struct l_dbus_message *disp_numeric_call(struct l_dbus *dbus, if (action_index < 0) return l_dbus_message_new_error(msg, dbus_err_support, NULL); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" str = l_strdup_printf(display_numeric_table[action_index].description, n); +#pragma GCC diagnostic pop bt_shell_printf(COLOR_YELLOW "%s\n" COLOR_OFF, str); l_free(str);