From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D398AA051C for ; Tue, 11 Feb 2020 12:22:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CCEAC2BF4; Tue, 11 Feb 2020 12:22:31 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id E98B45B3C for ; Tue, 11 Feb 2020 12:22:29 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id w15so11874901wru.4 for ; Tue, 11 Feb 2020 03:22:29 -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 :mime-version:content-transfer-encoding; bh=rGdsK/dC677pQvG48Sm8pRbFglY/2TaPDrqKhc6nXMs=; b=Z4PtYSatVC980CXICvTOsZfhv5gfDYP6gddZPNhdu+4IxcHxalmheLjCB5QEuRfdkC rl2eTwoBsUrVV4lC7/c9y81a07MjEssrZ+cuQUAl7l9vvzTexPc2zMq2eJN0OSrUavOv VVSIgNtAARFic7W4Sxhe4IZmdf8u9Bsl17+qxxoNV0GC5aFpKbW7c/AkBcdaULcUc2sb DgHVcxCQsrs+Q/gFBlg5Wl0mmpebpGZ1tiOJbjbuWVE91IGFr52sqsRFhLLwSGvRDRwH rtT//XmsBNl3lO2Q1Zoqo+Qv6kak2ZSDVrtr0KXU0GExOSIGChL8Ls8cROPsO8SPlUGc U7Uw== 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:mime-version:content-transfer-encoding; bh=rGdsK/dC677pQvG48Sm8pRbFglY/2TaPDrqKhc6nXMs=; b=QZ2st9thX9WY/yJtZn/naCT0iH3Gf+ZOFLKrtdnjClWh5h7qi1dhNNXx9xJGhMbuAy xGXHLhbFECspRBGWaeh21XQAd7lfAYZIpOaPJirsgaKHRig484CAytd4siS+OpQG0XSr Mf8DZUW706k4PYu3M6c7U7rRjhjOri6RhtWKEf/KXPkxqWDPKNCU68UI/7kEpbQ8Rz60 ONkq0/dtblZRtT2nck5Txk3eo6BGjGTkih3ZigTVdcDGElvYh6Xl/4LCXhZ1C+w9gVUa i77I5wGr8Ag1hw7GFJOyL0QeKANehcuHSrEQRlyiNajtyWQ64YvkwGniYlk9zMRd5kHz RbfA== X-Gm-Message-State: APjAAAVe6oGAsjbWAA50E+dQZbqQ0Mvm7o7GpnjJ2lMsDaFYis7YCVX4 1UHHudV87S+vBT/88i+2OBG5aoN5 X-Google-Smtp-Source: APXvYqwZLgYC2FMooh5ir1GfKc3f7aZ+6VV3QVJwdcZYuoIprPLTztyWoNCAb0dGXZBfLiBg50YiUA== X-Received: by 2002:a5d:4c88:: with SMTP id z8mr8014030wrs.395.1581420149678; Tue, 11 Feb 2020 03:22:29 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b10sm4751422wrw.61.2020.02.11.03.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:22:29 -0800 (PST) From: luca.boccassi@gmail.com To: Ali Alnubani Cc: Matan Azrad , dpdk stable Date: Tue, 11 Feb 2020 11:19:10 +0000 Message-Id: <20200211112216.3929-4-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx: fix build with clang 9' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/13/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 91a56fda7ef201133fb23fb53cd0f03fbf72ac38 Mon Sep 17 00:00:00 2001 From: Ali Alnubani Date: Wed, 11 Dec 2019 06:49:25 +0000 Subject: [PATCH] net/mlx: fix build with clang 9 [ upstream commit c3e89f69facbbfe131b6a6723665d48801ac943d ] This rewrites the MKSTR macro appending an empty string to its arguments to resolve build failures similar to: drivers/net/mlx4/mlx4.c:461:14: fatal error: format string is not a string literal [-Wformat-nonliteral] MKSTR(path, "%s/device/uevent", device->ibdev_path); drivers/net/mlx4/mlx4_utils.h:82:30: note: expanded from macro 'MKSTR' char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \ drivers/net/mlx5/mlx5_stats.c:144:15: fatal error: format string is not a string literal [-Wformat-nonliteral] MKSTR(path, "%s/ports/%d/hw_counters/%s", drivers/net/mlx5/mlx5_utils.h:149:30: note: expanded from macro 'MKSTR' char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \ The errors reproduce with clang version 9.0.0, and the release notes don't mention what could have caused them. Fixes: 7fae69eeff13 ("mlx4: new poll mode driver") Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters") Signed-off-by: Ali Alnubani Signed-off-by: Matan Azrad --- drivers/net/mlx4/mlx4_utils.h | 5 +++-- drivers/net/mlx5/mlx5_utils.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h index 74b9d2ecdc..5718b9c742 100644 --- a/drivers/net/mlx4/mlx4_utils.h +++ b/drivers/net/mlx4/mlx4_utils.h @@ -79,9 +79,10 @@ pmd_drv_log_basename(const char *s) /** Allocate a buffer on the stack and fill it with a printf format string. */ #define MKSTR(name, ...) \ - char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \ + int mkstr_size_##name = snprintf(NULL, 0, "" __VA_ARGS__); \ + char name[mkstr_size_##name + 1]; \ \ - snprintf(name, sizeof(name), __VA_ARGS__) + snprintf(name, sizeof(name), "" __VA_ARGS__) /** Generate a string out of the provided arguments. */ #define MLX4_STR(...) # __VA_ARGS__ diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h index b4ed8c6dad..ebf79b80a4 100644 --- a/drivers/net/mlx5/mlx5_utils.h +++ b/drivers/net/mlx5/mlx5_utils.h @@ -146,9 +146,10 @@ extern int mlx5_logtype; /* Allocate a buffer on the stack and fill it with a printf format string. */ #define MKSTR(name, ...) \ - char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \ + int mkstr_size_##name = snprintf(NULL, 0, "" __VA_ARGS__); \ + char name[mkstr_size_##name + 1]; \ \ - snprintf(name, sizeof(name), __VA_ARGS__) + snprintf(name, sizeof(name), "" __VA_ARGS__) /** * Return logarithm of the nearest power of two above input value. -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:39.047123217 +0000 +++ 0004-net-mlx-fix-build-with-clang-9.patch 2020-02-11 11:17:38.303999552 +0000 @@ -1,8 +1,10 @@ -From c3e89f69facbbfe131b6a6723665d48801ac943d Mon Sep 17 00:00:00 2001 +From 91a56fda7ef201133fb23fb53cd0f03fbf72ac38 Mon Sep 17 00:00:00 2001 From: Ali Alnubani Date: Wed, 11 Dec 2019 06:49:25 +0000 Subject: [PATCH] net/mlx: fix build with clang 9 +[ upstream commit c3e89f69facbbfe131b6a6723665d48801ac943d ] + This rewrites the MKSTR macro appending an empty string to its arguments to resolve build failures similar to: @@ -25,7 +27,6 @@ Fixes: 7fae69eeff13 ("mlx4: new poll mode driver") Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters") -Cc: stable@dpdk.org Signed-off-by: Ali Alnubani Signed-off-by: Matan Azrad