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 90A36A04B2 for ; Mon, 31 Aug 2020 23:38:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 64DC31C0C5; Mon, 31 Aug 2020 23:38:24 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id 5C1911C0BD; Mon, 31 Aug 2020 23:38:21 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id w14so8457482ljj.4; Mon, 31 Aug 2020 14:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k7eIcKFodHPSC3NjAXsycbfXRbqMlxk5IIp8lzhwCFM=; b=NVSKY4bZ3mxdwYahUQgUoBFJj9oNPyPaCD4Q1Q3GQqwoBMPZaSOEoPMRMzTHRslcnf e03MgWKJCMaY6vzLwttNvI//k2PhXUKEdsiAsfjod2QxFEsYS7jBtxXl8DkK3QO3NMM4 A1H1sVhQfWIqo3kjKJfN9xebXvbKJeszfo4BF5IrAOOlVp9UBgOM+5dAmwcaZnghu53Q bdKBljz26w1qvf8zj8vhffotBKg8ewFfJEMk/aVnVm6+w+mmz+GxWcVs2eaHDA90Jtth J/JLURhZn4A0VBOD3ZH6eFxC67kCmd++rT/6/aowWmruVpiZxU5fX4Qs/Jx127Ez/TB4 yUtA== 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:mime-version :content-transfer-encoding; bh=k7eIcKFodHPSC3NjAXsycbfXRbqMlxk5IIp8lzhwCFM=; b=tOpemDAvZasskIpj7m2fQIO7RA4KcqijOVm5rSezu3gS5MH10Weqb+ODWgcY1dQqDZ muobZIX5ytCtwZgX1tnib3JEysZovdpV3E458l3aMZk6DU1A8r/ABy0VRSQ1XCmAjHvm Xzb01UQu1hub+Q0+yzcvEnOBjBGwduom7JAW3nPdBs1KU6cgGzi16ljUBmENAYvNwuvW X0eM/FNNRUVsO3sLor2qyY4NJScfsZelA03W0+TResbbYg8NYqWho3Xwy+uJvzZ9cInF 6iFBY6mYha5Ri4dyGYZq+vKRJZ2p+6D64TgAGKymPrsvyBGyGoQP2suNwAOe1JdUSaZ0 UexA== X-Gm-Message-State: AOAM532J1KefOOn7zqj63eJYkhSVU/r+G3vkP9pT427BXQIgkRw19SEh n0+38Z8e6TG0IY7CLt9nn47tYIGuGgHLfQ== X-Google-Smtp-Source: ABdhPJz04WPGkpR7/ZMwFYuyLNsiz6KHZVVzLa1bCmd3SgXaKEiGUIuv5xnM+q3ZIil5Qw/HkE86SA== X-Received: by 2002:a05:651c:1119:: with SMTP id d25mr1339687ljo.300.1598909900469; Mon, 31 Aug 2020 14:38:20 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id v5sm1803692ljh.73.2020.08.31.14.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 14:38:19 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , stable@dpdk.org, Honnappa Nagarahalli Date: Tue, 1 Sep 2020 00:38:11 +0300 Message-Id: <20200831213811.21521-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] rcu: avoid literal suffix warning in C++ mode 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" Sequences like "value = %"PRIu64 (no space before PRIu64) are parsed as a single preprocessor token, user-defined-string-literal, in C++11 onwards. While modern compilers are smart enough to parse this properly, GCC 9.3.0 generates warnings like: rte_rcu_qsbr.h:555:26: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] Add spaces around format specifier macros to make public headers compatible with C++ without causing warnings. Fixes: 64994b56c ("rcu: add RCU library supporting QSBR mechanism") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk --- lib/librte_rcu/rte_rcu_qsbr.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/librte_rcu/rte_rcu_qsbr.h b/lib/librte_rcu/rte_rcu_qsbr.h index a98e8f0f8..aa237cf75 100644 --- a/lib/librte_rcu/rte_rcu_qsbr.h +++ b/lib/librte_rcu/rte_rcu_qsbr.h @@ -552,7 +552,7 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id) __atomic_store_n(&v->qsbr_cnt[thread_id].cnt, t, __ATOMIC_RELEASE); - __RTE_RCU_DP_LOG(DEBUG, "%s: update: token = %"PRIu64", Thread ID = %d", + __RTE_RCU_DP_LOG(DEBUG, "%s: update: token = %" PRIu64 ", Thread ID = %d", __func__, t, thread_id); } @@ -580,13 +580,13 @@ __rte_rcu_qsbr_check_selective(struct rte_rcu_qsbr *v, uint64_t t, bool wait) while (bmap) { j = __builtin_ctzl(bmap); __RTE_RCU_DP_LOG(DEBUG, - "%s: check: token = %"PRIu64", wait = %d, Bit Map = 0x%"PRIx64", Thread ID = %d", + "%s: check: token = %" PRIu64 ", wait = %d, Bit Map = 0x%" PRIx64 ", Thread ID = %d", __func__, t, wait, bmap, id + j); c = __atomic_load_n( &v->qsbr_cnt[id + j].cnt, __ATOMIC_ACQUIRE); __RTE_RCU_DP_LOG(DEBUG, - "%s: status: token = %"PRIu64", wait = %d, Thread QS cnt = %"PRIu64", Thread ID = %d", + "%s: status: token = %" PRIu64 ", wait = %d, Thread QS cnt = %" PRIu64 ", Thread ID = %d", __func__, t, wait, c, id+j); /* Counter is not checked for wrap-around condition @@ -643,12 +643,12 @@ __rte_rcu_qsbr_check_all(struct rte_rcu_qsbr *v, uint64_t t, bool wait) for (i = 0, cnt = v->qsbr_cnt; i < v->max_threads; i++, cnt++) { __RTE_RCU_DP_LOG(DEBUG, - "%s: check: token = %"PRIu64", wait = %d, Thread ID = %d", + "%s: check: token = %" PRIu64 ", wait = %d, Thread ID = %d", __func__, t, wait, i); while (1) { c = __atomic_load_n(&cnt->cnt, __ATOMIC_ACQUIRE); __RTE_RCU_DP_LOG(DEBUG, - "%s: status: token = %"PRIu64", wait = %d, Thread QS cnt = %"PRIu64", Thread ID = %d", + "%s: status: token = %" PRIu64 ", wait = %d, Thread QS cnt = %" PRIu64 ", Thread ID = %d", __func__, t, wait, c, i); /* Counter is not checked for wrap-around condition @@ -725,10 +725,10 @@ rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait) /* Check if all the readers have already acknowledged this token */ if (likely(t <= v->acked_token)) { __RTE_RCU_DP_LOG(DEBUG, - "%s: check: token = %"PRIu64", wait = %d", + "%s: check: token = %" PRIu64 ", wait = %d", __func__, t, wait); __RTE_RCU_DP_LOG(DEBUG, - "%s: status: least acked token = %"PRIu64"", + "%s: status: least acked token = %" PRIu64, __func__, v->acked_token); return 1; } -- 2.25.4