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 12D2BA00BE; Tue, 7 Jul 2020 15:57:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 440DC1DC86; Tue, 7 Jul 2020 15:57:21 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id B354A1D617 for ; Tue, 7 Jul 2020 15:57:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594130239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=y1AXsPnXfu4UzMsUIfbtP777BdtLyPOD7xEfPJqwWIg=; b=KHpLNR9u1/Jwr54winHxnnniiOEFFKnBW58X133sZaTz+VYtYoD3eyvqJoogDSbGk4zbKL qrh2CHE0sGlnJqcc4gprA+uXEQ6oQzQULWbQ/ryq1a/5Jd6vTJRqYOWC4NznbF4ZMoux45 JyQD3iALA8cwg3u8LK5QgGv2HOoiOBg= Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-361-Lsya6IswPDyYl7UilD3nwQ-1; Tue, 07 Jul 2020 09:57:17 -0400 X-MC-Unique: Lsya6IswPDyYl7UilD3nwQ-1 Received: by mail-vk1-f199.google.com with SMTP id d188so7909625vka.21 for ; Tue, 07 Jul 2020 06:57:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y1AXsPnXfu4UzMsUIfbtP777BdtLyPOD7xEfPJqwWIg=; b=OgHh/nBVtt1nLZR6osni0PnWHkoKF8B9iNOwGf7hExNjCXzzztwPvy5kr2T/RtYeZm 6E4C2FgsRlkE+BzJIFdd/SGzFydPXsMhQhEdEflnn6lS+A6F1FSDnJnq3L0oaj9rmqq+ qgEm/MYTDQxjWbd1oC75/5RxVSPo8h0erqFPQRBTNQxEziuMZhHO1c8+TrJxPhBOtKsz RIolNuzgNaJ86w4CGkQJYmWGA9677o8iEhFhwHu5D67UWEf3x2C+BKXvTKLulrLJ0mvq TpSvv1Sh4Rl+2QHCj91JrEy/IOuzY9qdrWaKeImQWKJ4uUjOICk3DqN6yW/cWVA7BkyF 5Y+Q== X-Gm-Message-State: AOAM5322BpX7L0R7x9NbmxCSa+bQjtapqpsfeEUjlBiOU6r7qSWNXPVP JCo2gzsdAqvFM2/tytCG3qYxqmL2Yy0D0m+2toDNs9bueEr7TENpAhxiCfd4FgQOdJh7DjxK/hX TbqHG/jmibDPC5LJPoe4= X-Received: by 2002:a67:26c2:: with SMTP id m185mr38102558vsm.39.1594130237074; Tue, 07 Jul 2020 06:57:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP3vfs7Irie5ZLMi/Nu63dC0pCpgEGO8Qoa1dfJTSwy7p8Zy2LfpjoWRUTAJd008cxQU8hyvV5if6UnzGScME= X-Received: by 2002:a67:26c2:: with SMTP id m185mr38102539vsm.39.1594130236855; Tue, 07 Jul 2020 06:57:16 -0700 (PDT) MIME-Version: 1.0 References: <20200611033248.39049-1-joyce.kong@arm.com> <20200706074930.54299-1-joyce.kong@arm.com> <20200706074930.54299-2-joyce.kong@arm.com> In-Reply-To: <20200706074930.54299-2-joyce.kong@arm.com> From: David Marchand Date: Tue, 7 Jul 2020 15:57:05 +0200 Message-ID: To: Joyce Kong Cc: Maxime Coquelin , Jerin Jacob Kollanukkaran , Zhihong Wang , Xiaolong Ye , Beilei Xing , Jeff Guo , "Mcnamara, John" , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Honnappa Nagarahalli , Phil Yang , "Ruifeng Wang (Arm Technology China)" , dev , nd Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 1/6] lib/eal: add a common wrapper for restricted pointers 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 Mon, Jul 6, 2020 at 9:50 AM Joyce Kong wrote: > > The 'restrict' keyword is recognized in C99, while type qulifier > '__restrict' compiles ok in C with all language levels. This patch > is to add a wrapper defining '__rte_restrict' with 'restrict' and > '__restrict' to be supported by all compilers. > > Signed-off-by: Joyce Kong > --- > lib/librte_eal/include/rte_common.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h > index 0843ce69e..cda32c056 100644 > --- a/lib/librte_eal/include/rte_common.h > +++ b/lib/librte_eal/include/rte_common.h > @@ -103,6 +103,16 @@ typedef uint16_t unaligned_uint16_t; > */ > #define __rte_unused __attribute__((__unused__)) > > +/** > + * Define a wrapper for restricted pointers which can be supported > + * by all compilers. > + */ > +#if __STDC_VERSION__ >= 199901 > +#define __rte_restrict restrict > +#else > +#define __rte_restrict __restrict > +#endif > + > /** > * definition to mark a variable or function parameter as used so > * as to avoid a compiler warning > -- > 2.27.0 > This triggers a build error on Centos 7 as reported by the CI. I suppose the following would do the trick, though it is untested: /** * Define a wrapper for restricted pointers which can be supported * by all compilers. */ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L #define __rte_restrict __restrict #else #define __rte_restrict restrict #endif -- David Marchand