From patchwork Fri Jan 18 12:46:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 10770015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51BF913BF for ; Fri, 18 Jan 2019 12:48:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40BC929CF9 for ; Fri, 18 Jan 2019 12:48:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EF2B29D79; Fri, 18 Jan 2019 12:48:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D0E032C210 for ; Fri, 18 Jan 2019 12:48:17 +0000 (UTC) Received: from localhost ([127.0.0.1]:38233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkTZJ-0004iG-27 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 18 Jan 2019 07:48:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkTXm-0003W6-Bi for qemu-devel@nongnu.org; Fri, 18 Jan 2019 07:46:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkTXj-0008CP-LB for qemu-devel@nongnu.org; Fri, 18 Jan 2019 07:46:42 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:40439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkTXh-00080y-EU; Fri, 18 Jan 2019 07:46:37 -0500 Received: by mail-wm1-x343.google.com with SMTP id f188so4358631wmf.5; Fri, 18 Jan 2019 04:46:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VPsuqQD7CnlmDsB6zbi+FLfyXcMrdY20TQwjabS1Gqk=; b=qL0GsGJdbkeVt3IneNVPFwgasLNOFWc4Haocs+CDvSstqvbsnZArCInJwN/6kvzNpJ nFjUuCB1/0/opL+EGPGzkpvit7zveSmgrJYN1qsgkb3ru5Ti6DTnvJzwF5XFg2dkDjZj rOqfUlDFWBttLNmS3VNo/Hy4BtfcZLpkQk//cMtt3ilXZt7caHCB7Cied8Xhgqizk2+t bjAtksz1IPVWpwIikPldcB4vm/B2bqnS1wXIU0IGV2O3jNlV9ViVpC7wnjbm2QVEeTrY s4a3wsLaa/Mz+XrKd4Ide0gVwyPKX7xw7+lBR3jDlw/LvZhjjM70mHunbjw8k6hmIl+Q Mogg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VPsuqQD7CnlmDsB6zbi+FLfyXcMrdY20TQwjabS1Gqk=; b=qro9nQVmIPyHUvew3jA91ReAoCj3MF0sCb/shzvacXYvxJjUz66QBZ+cE+Md1Vv2RF FOtP6SUl5sm0xn+BHtjgzmpCrs91x675sxiEewFxZ1KnH+clKSmqydDOep8X27OS3aul 90rQ8xZdVDWN9VS7k4eaYq7jz3kSQdzZYx2J3s/vM128VGozvyU97G82LfEtIJMjEc/z 5cE5EE+2GVhTDMYGXa9xMUsCIcr0eQROrNqQNbmNDbWMIaByTA5kFCv/cip1ziWTekrA UA1hh2hoqjlEm2pRs28pDPuFnIfRcoLVlhcJ4ZgboxGDSoDgyJP2l46LJ7Egv1QoX34D UwMA== X-Gm-Message-State: AJcUukdnZBEOGh61zMtC33mxgYaWAyo18SLr8RLMLGz7fGQ2YPbl82Nh tBgeFPZpTT+Q7sYcXKHfHoxGzZE/ X-Google-Smtp-Source: ALg8bN4CCDV7ejH16DjtWFRkSoPwbeO/Xs1SpnJnse9cLnEx9OiHakskrUBvhVmxROJL3SdTpHl6zw== X-Received: by 2002:a1c:68d7:: with SMTP id d206mr14999252wmc.43.1547815579235; Fri, 18 Jan 2019 04:46:19 -0800 (PST) Received: from localhost.localdomain ([176.228.155.165]) by smtp.gmail.com with ESMTPSA id n15sm69542124wrt.21.2019.01.18.04.46.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 04:46:18 -0800 (PST) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 18 Jan 2019 14:46:12 +0200 Message-Id: <20190118124614.24548-2-marcel.apfelbaum@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190118124614.24548-1-marcel.apfelbaum@gmail.com> References: <20190118124614.24548-1-marcel.apfelbaum@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH v2 1/3] contrib/rdmacm-mux: remove Wno-format-truncation flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cohuck@redhat.com, qemu-stable@nongnu.org, yuval.shaia@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The flag is not recognized by some CLANG versions. Add proper constraints in code instead. Reviewed-by: Yuval Shaia Tested-by: Cornelia Huck Signed-off-by: Marcel Apfelbaum --- contrib/rdmacm-mux/Makefile.objs | 2 +- contrib/rdmacm-mux/main.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/rdmacm-mux/Makefile.objs b/contrib/rdmacm-mux/Makefile.objs index be3eacb6f7..e1ff4fe569 100644 --- a/contrib/rdmacm-mux/Makefile.objs +++ b/contrib/rdmacm-mux/Makefile.objs @@ -1,4 +1,4 @@ ifdef CONFIG_PVRDMA -CFLAGS += -libumad -Wno-format-truncation +CFLAGS += -libumad rdmacm-mux-obj-y = main.o endif diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c index 835a7f9214..64676030c5 100644 --- a/contrib/rdmacm-mux/main.c +++ b/contrib/rdmacm-mux/main.c @@ -42,6 +42,8 @@ /* The below can be override by command line parameter */ #define UNIX_SOCKET_PATH "/var/run/rdmacm-mux" +/* Has format %s-%s-%d" -- */ +#define SOCKET_PATH_MAX (PATH_MAX - NAME_MAX - sizeof(int) - 2) #define RDMA_PORT_NUM 1 typedef struct RdmaCmServerArgs { @@ -95,7 +97,7 @@ static void help(const char *progname) static void parse_args(int argc, char *argv[]) { int c; - char unix_socket_path[PATH_MAX]; + char unix_socket_path[SOCKET_PATH_MAX]; strcpy(server.args.rdma_dev_name, ""); strcpy(unix_socket_path, UNIX_SOCKET_PATH); @@ -113,7 +115,7 @@ static void parse_args(int argc, char *argv[]) case 's': /* This is temporary, final name will build below */ - strncpy(unix_socket_path, optarg, PATH_MAX); + strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX); break; case 'p':