From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 6997C1B161 for ; Sun, 19 Nov 2017 15:41:24 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id y80so14096353wmd.0 for ; Sun, 19 Nov 2017 06:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=OaOLIHFvwy17V/wdsfr+J5S5Ja4SbnxgtW2Tp/Dvdug=; b=XL1h2LfbOXiAFBxRCaYNr3Q3My25pJvygp9EHoUW6vDacMIcmR6DKl77lYd0WZH3t8 vC46SJoyqPmr4tQxnhzrwRKG5fjzDN2seGWKtJkbdbJY+s9AZ9JW7cqQEhR+zJ2RvvCj zVqmd4CLvYFfWMyBpVjsYm10lUio4kzrDDkXq9YOMW5+7wS0qlZc1OGGzMRlIEQz0+EM DiVO2AVOOEfACdQfDxykhE5RIYaUUBHi5zKVta7GzNnFn93RRBKaNPdhmC8Rt3lpXmMA ys3uxA26ARwoKyf5PFow7tV+aVbXdZo1BWu5jbv7zC6EHBsedRpCo3utCmUqK8Paso5W C7Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=OaOLIHFvwy17V/wdsfr+J5S5Ja4SbnxgtW2Tp/Dvdug=; b=r7Wsfd2FDyLbFxddoGGif8t+zs4UWdLrVHo6uTmsD/LZg7mRLK76Y3dgbJ7xD445Hm zvy11b1c7OzXJGZkxkqvCzgS92X+PZnZ6s7gBti17NNd/emDG+c15XQz64/YPhkXZDfk ErYwh7EZFMBaxrq81aS+FDmg/NdSjWMIKRrv1Oxch0LEdD4+5I9BDeEICOnLbSmFtmN3 ljb6R3J1pSYS/3LP1Uj2jXG95d38wLETX/rfdyPHRdp/TzDLNfNiQm1pN5SLn0KEO8mA u5oOG5lzOf/mu+Z4Lz4pKZ1nPtYTBFm9v/eIy2Wh9KqtFebAmRdbGvbhaUFajN4y5lqr B6EA== X-Gm-Message-State: AJaThX5VV+Tb/rgHm8QfFkRHK7WdJOCFt+d+PRvG6N1HH+P86qYkHi74 ngZBzD21j/GQAsHR24CJl8izTzyA X-Google-Smtp-Source: AGs4zMYl0uhI5dVUbQl9QLMXbmwPVsSWTIk1av1rS50lu1LH5fi7HFr54MhLKgvtKKzgR9bexbIE4Q== X-Received: by 10.80.162.231 with SMTP id 94mr15998084edm.280.1511102483871; Sun, 19 Nov 2017 06:41:23 -0800 (PST) Received: from [10.61.0.167] (bba193485.alshamil.net.ae. [217.165.96.191]) by smtp.gmail.com with ESMTPSA id k19sm6309633ede.35.2017.11.19.06.41.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 06:41:23 -0800 (PST) From: Ilya Matveychikov Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Date: Sun, 19 Nov 2017 18:41:20 +0400 References: <9B0F484B-2803-4882-B324-8E4B1AFEFAF2@gmail.com> To: dev@dpdk.org In-Reply-To: <9B0F484B-2803-4882-B324-8E4B1AFEFAF2@gmail.com> Message-Id: <76A6A6A4-98AC-4765-9579-44100B4CE159@gmail.com> X-Mailer: Apple Mail (2.3445.4.7) Subject: Re: [dpdk-dev] [PATCH] debug: update assertion macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 14:41:24 -0000 > On Nov 19, 2017, at 12:18 PM, Ilya Matveychikov = wrote: >=20 > Update RTE_VERIFY macro to make it possible to use complex expressions > in RTE_ASSERT. >=20 > Signed-off-by: Ilya V. Matveychikov >=20 > Fixes: 148f963fb532 ("xen: core library changes") > Cc: bruce.richardson@intel.com >=20 > --- > Now it's incorrect to use complex expressions for assertion > like RTE_ASSERT((1 + 2) =3D=3D 3). This patch makes it possible. Update. Now it=E2=80=99s possible to have % char inside the expression, for = example: RTE_ASSERT((sizeof(some_struct) % 64) =3D=3D 0) Before the patch, =E2=80=9C%" sign acts like a conversion specification = beginning character. >=20 > lib/librte_eal/common/include/rte_debug.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_eal/common/include/rte_debug.h = b/lib/librte_eal/common/include/rte_debug.h > index 79b67b3ec..fbb3bb5e5 100644 > --- a/lib/librte_eal/common/include/rte_debug.h > +++ b/lib/librte_eal/common/include/rte_debug.h > @@ -86,7 +86,7 @@ void rte_dump_registers(void); > #endif > #define RTE_VERIFY(exp) do { = \ > if (unlikely(!(exp))) = \ > - rte_panic("line %d\tassert \"" #exp "\" failed\n", = __LINE__); \ > + rte_panic("line %d\tassert \"%s\" failed\n", __LINE__, = #exp); \ > } while (0) >=20 > /* > -- > 2.15.0