From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA39443C2C; Wed, 28 Feb 2024 18:27:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B41840E0F; Wed, 28 Feb 2024 18:27:36 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6B304402E3 for ; Wed, 28 Feb 2024 18:27:34 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8F46120B74C0; Wed, 28 Feb 2024 09:27:33 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8F46120B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709141253; bh=aRvrrdsQ9ME2IhWH9a0D24wXkOPi+hg16IuICqMmgfI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HGK3jRSpngAHIgGqdOsSSE7uZzklREewRZKUThzlAfNgu6HZtEySlEq5kpblOI8tm lV9bpyXughm91FqhWbVLUhk7QCbgtpcXJIKton8fePTaDlbhfsIWHZeclbrf93naFQ RSSiKbYHTHO1+nA85cxULZv2uMn/49WS7+VDHPjw= Date: Wed, 28 Feb 2024 09:27:33 -0800 From: Tyler Retzlaff To: David Marchand Cc: Stephen Hemminger , dev@dpdk.org, Anatoly Burakov , Ashish Gupta , Chenbo Xia , Cristian Dumitrescu , David Hunt , Fan Zhang , Hemant Agrawal , Honnappa Nagarahalli , Jasvinder Singh , Jerin Jacob , Konstantin Ananyev , Maxime Coquelin , Reshma Pattan , Sachin Saxena , Sivaprasad Tummala , Srikanth Yalavarthi , Sunil Kumar Kori , bruce.richardson@intel.com, mb@smartsharesystems.com, thomas@monjalon.net Subject: Re: [PATCH v3 00/16] stop using variadic argument pack extension Message-ID: <20240228172733.GB7059@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1707774557-16012-1-git-send-email-roretzla@linux.microsoft.com> <1708978786-6740-1-git-send-email-roretzla@linux.microsoft.com> <20240226125436.046684e7@hermes.local> <20240227181446.GA18561@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Feb 28, 2024 at 12:45:04PM +0100, David Marchand wrote: > On Tue, Feb 27, 2024 at 7:15 PM Tyler Retzlaff > wrote: > > > > On Mon, Feb 26, 2024 at 12:54:36PM -0800, Stephen Hemminger wrote: > > > On Mon, 26 Feb 2024 12:19:30 -0800 > > > Tyler Retzlaff wrote: > > > > > > > RTE_LOG_LINE cannot be augmented with a prefix format and arguments > > > > without the user of RTE_LOG_LINE using the args... and ## args compiler > > > > extension to conditionally remove trailing comma when the macro receives > > > > only a single argument. > > > > > > > > Provide a new/similar macro RTE_LOG_LINE_PREFIX that accepts the prefix > > > > format and arguments as separate parameters allowing them to be expanded > > > > at the correct locations inside of RTE_FMT() allowing the rest of the > > > > non-prefix format string and arguments to be collapsed to the argument > > > > pack which can be directly forwarded with __VA_ARGS__ avoiding the need > > > > for conditional comma removal. > > > > > > > > I've done my best to manually check expansions (preprocessed) and compiled > > > > printf of the logs to validate correct output. > > > > > > > > note: due to drastic change in series i have not carried any series acks > > > > forward. > > > > > > The changes look good, you might want to add release note, update coding > > > style doc, and/or update checkpatch to discourage re-introduction. > > > > re-introduction should be protected by the CI. i know checkpatch would > > be better but i couldn't think of a good way to match an arbitrarily > > named pack ... reliably where it could potentially cause noise. > > What about a simple: > > + # forbid use of variadic argument pack extension in macros > + awk -v FOLDERS="lib drivers app examples" \ > + -v > EXPRESSIONS='#[[:space:]]*define.*[^(,[:space:]]\\.\\.\\.[[:space:]]*)' > \ > + -v RET_ON_FAIL=1 \ > + -v MESSAGE='Do not use variadic argument pack in macros' \ > + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ > + "$1" || res=1 > + I have no objection, I suppose worst case scenario if it turns out to catch things we don't want it to catch we can always ignore or remove it. I will add the check and submit a new rev. > > > -- > David Marchand