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 C58F4A046B for ; Thu, 27 Jun 2019 14:39:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A02B61B95D; Thu, 27 Jun 2019 14:39:04 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 763B31B950 for ; Thu, 27 Jun 2019 14:39:02 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id v14so2395075wrr.4 for ; Thu, 27 Jun 2019 05:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=8kuqEz8LEqT8sbqionu2Qb2Nv5sduOAUmpAJGrTff0g=; b=P9UdXIIDoRE+2DgezvIfHl673MFXTO4PBvi8dQlAFktlUWf1BT+YQQDKp8BoWj9+AR BMI6BKQMATmDigWauaFo6bTp7wtYzlxY5AP5BS64OPQIYSCD7bQ2xXdRx8908Ot72HIF Cvy+jxchI0zsIv44WQNzi9uXWjmWu7V513WtzzE5sMYEkmeNfHgW2B1zRbOSEMstfcJO 61Fjdgj6QctDW06C06Ld95IZHz52cR8I1aEdI2C94zIeNAXvO6SiKtL1d1QcTnaw0Nnz t0dVcPtpQjY0MJrwU1RB863ryhp9bK6G/tHIFobk748iQCv46fjvKAzMGwS1zc5Tj8cL o/DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=8kuqEz8LEqT8sbqionu2Qb2Nv5sduOAUmpAJGrTff0g=; b=lCxL7iotrlda9iemQs/JjOpeRJ3RNdYMZxEnNFJSCUDO9LcNQOPT4WpqtiEWQzrfZX uGmA5mvdmqRJg6MXZeWFqBwoGJMwLWjUJWpvOJZhLnANLnyV7/PXT9Yrvcnmhm/hTkGF yD6uT2DSRfI+waQ5/qyw6QeMaSLu/h+SfTKVjd18ASfvJmQ4R5d1hzHOSNwiAN+Euoim iE9fFPMYwrT5sdcH7xmINt1m5Q5nzielfQ6XPVV0ox5cJLwhfuv0ojKU5DmFIaIZgW7K zBTpIVorjWrBauCw7x786lVnxZgU6sFsTmbt8o3wPvxA9hevLJHFzsxvgCelXylJZeV2 zAmA== X-Gm-Message-State: APjAAAWIAwJkrGvFQ2uvmGuKjeze9rKy2ntBhYNFy/XUd0dOmhOqovUk EiMSa3wRccg8hvUDFbDD15++0A== X-Google-Smtp-Source: APXvYqxLS6g/rEeAHf/BLY8HWT/DTAWlIfvYmxMlgyNveDm50dXiEXDWlqFSsad7K2cQRzEIc0qHIQ== X-Received: by 2002:adf:b78c:: with SMTP id s12mr2931998wre.264.1561639142498; Thu, 27 Jun 2019 05:39:02 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id o8sm2462148wrj.71.2019.06.27.05.39.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jun 2019 05:39:01 -0700 (PDT) Date: Thu, 27 Jun 2019 14:38:59 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Adrien Mazarguil Cc: David Marchand , dev@dpdk.org, nhorman@tuxdriver.com, aconole@redhat.com, thomas@monjalon.net, Wenzhuo Lu , Konstantin Ananyev , Jasvinder Singh , Cristian Dumitrescu , Amr Mokhtar , Fiona Trahe , Pablo de Lara , Ashish Gupta , Declan Doherty , Bruce Richardson , Joyce Kong , Anatoly Burakov , Harry van Haaren , Ferruh Yigit , Andrew Rybchenko , Nikhil Rao , Jerin Jacob , Bernard Iremonger , Yipeng Wang , Sameh Gobriel , Olivier Matz , David Hunt , Honnappa Nagarahalli , Akhil Goyal , Gage Eads , Kevin Laatz , Robert Sanford , Erik Gabriel Carrillo , Maxime Coquelin , Tiwei Bie , Zhihong Wang Message-ID: <20190627123859.aixiatdlmm5okgt7@bidouze.vm.6wind.com> References: <1561635235-22238-1-git-send-email-david.marchand@redhat.com> <1561635235-22238-10-git-send-email-david.marchand@redhat.com> <20190627122359.GN4284@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190627122359.GN4284@6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 9/9] enforce __rte_experimental at the start of symbol declarations 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jun 27, 2019 at 02:23:59PM +0200, Adrien Mazarguil wrote: > Hey David, > > On Thu, Jun 27, 2019 at 01:33:55PM +0200, David Marchand wrote: > > Putting a '__attribute__((deprecated))' in the middle of a function > > prototype does not result in the expected result with gcc (while clang > > is fine with this syntax). > > > > $ cat deprecated.c > > void * __attribute__((deprecated)) incorrect() { return 0; } > > __attribute__((deprecated)) void *correct(void) { return 0; } > > int main(int argc, char *argv[]) { incorrect(); correct(); return 0; } > > $ gcc -o deprecated.o -c deprecated.c > > deprecated.c: In function ‘main’: > > deprecated.c:3:1: warning: ‘correct’ is deprecated (declared at > > deprecated.c:2) [-Wdeprecated-declarations] > > int main(int argc, char *argv[]) { incorrect(); correct(); return 0; } > > ^ > > > > Let's enforce the tag is at the very start of the lines, this is not > > perfect but we will trust reviewers to catch the other not so easy to > > detect patterns. > > > > tag=__rte_experimental > > git grep -l [^^]$tag |grep \\.h$ |while read file; do > > [ "$file" != 'lib/librte_eal/common/include/rte_compat.h' ] || > > continue > > sed -i -e 's#^\(.*\) *'$tag'#'$tag' \1#' $file > > sed -i -e 's#^\(..*\)'$tag'#'$tag' \1#' $file > > done > > Just a suggestion, how about putting __rte_experimental on its own line > before the actual prototype? So that instead of: > > __rte_experimental struct rte_compressdev * __rte_experimental > rte_compressdev_pmd_get_named_dev(const char *name); > > We'd get: > > __rte_experimental > struct rte_compressdev * > rte_compressdev_pmd_get_named_dev(const char *name); > > I personally find the latter much more readable. +1, with the added benefit of having only one line to remove when making the API stable, which is critical. > > Here's the relevant sed expression: > > sed -i \ > -e '/^\([^#].*\)__rte_experimental */{' \ > -e 's//\1/; s/ *$//; i\' \ > -e __rte_experimental \ > -e '}' \ > $(git grep -l __rte_experimental -- '*.h') > > Otherwise this series looks good to me. > > -- > Adrien Mazarguil > 6WIND -- Gaëtan Rivet 6WIND