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 70D88A046B for ; Thu, 27 Jun 2019 14:24:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33F734CA9; Thu, 27 Jun 2019 14:24:04 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id AD0004C99 for ; Thu, 27 Jun 2019 14:24:02 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id s3so5532622wms.2 for ; Thu, 27 Jun 2019 05:24: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; bh=ryu1aG32h0+pyUZma9LvTsrplof4DToc2EIsVzy/cJE=; b=gh8ZBEEePG/hp3kUfrr71K2LTCAYrii9kUo7eUM3i8LNNcv9palcHcAQUjES+czICj M0SpZcGZHXDYvwoira3XXM2EOmOkGvD5f8c11t4dKmR8AAuf1uyIeEcGzDc2qMG/Ka3r B3kY6wSEztzhEZ0RWI0Rwhk0WBGBNt1CmQthRqQWfkXYnG+qdHdC4XpjZbRT1WGXu5wa /oLA7xZY4bCT0A/LQw4SDk9uEFMXDKVEMqKEHfrvvWR/IZA4OXCuhN+BgHKkPIgfvc8T gnPgd+HKUkWyjgB0V1PcYNiQM2TWAAmOTxD4fJZMTtYV2ZB+wqnOHp3tNxobfS1n2e7u ayzA== 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; bh=ryu1aG32h0+pyUZma9LvTsrplof4DToc2EIsVzy/cJE=; b=cR1J8XU4zxmniSgV+kFYHFB7zIOMwMRu5aECWhRFSNzrrL5eYaQIxyWtyBM+CyU0MA 26Av6jADbERnfdawEeMWu+1o19g+F5BaU6AdpqHGaOvpGIEXj01a+Ok57ugn1W1UmGfP U4SdMooHCX0pMkKdtK0wRVSk9lAEFfXimATio71EK/RFJQpn6NxDMWN06OjFH/BoukQ4 Gi0g1QQtaDpDKKF9HicmtkMUBUA0N6H0ffQXPzbY72Y1JenHle2P7tMwt0vy8yOE04iE kLaiS0PdPqU/lYv+RsBbzDSfDq6i4RaH5F2D27Hxvdfb9EHuumIvovLZSPCHcQ6H9njw bTlA== X-Gm-Message-State: APjAAAXGy7xqeI4eTKEmVb/giT6pyZQaqSt4QytLAjNl1kJxYZFUu2mV Rkt2SEbFBDHGw5agKc+avq4J0Q== X-Google-Smtp-Source: APXvYqxwoSTlWz4NGESnYAzlTd5AFplNyVpY4hUYMfrf/oUMDl3l/BxWa6tieHt5d9GosYzBdsUeQQ== X-Received: by 2002:a05:600c:23d2:: with SMTP id p18mr1186599wmb.108.1561638242057; Thu, 27 Jun 2019 05:24:02 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f204sm7122910wme.18.2019.06.27.05.24.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 05:24:01 -0700 (PDT) Date: Thu, 27 Jun 2019 14:23:59 +0200 From: Adrien Mazarguil To: David Marchand Cc: 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: <20190627122359.GN4284@6wind.com> References: <1561635235-22238-1-git-send-email-david.marchand@redhat.com> <1561635235-22238-10-git-send-email-david.marchand@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1561635235-22238-10-git-send-email-david.marchand@redhat.com> 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" 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. 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