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 8BA23A0C45; Wed, 27 Oct 2021 10:42:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7AEF340040; Wed, 27 Oct 2021 10:42:38 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E8FF04003F for ; Wed, 27 Oct 2021 10:42:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635324156; 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=OOlw6qjWi33xj030By3H9sNLkrBuTCXW0LBQFCf2Ymc=; b=E2DMJbPVRs5KW47Nnc9wo/bndVDOHu2E3C9X8TzyyeyPQ9b4Ck2z6sLytubt15obI5alT+ c0K/xzODuUcf2x8vwheELi4yHVWU22tvJlKm4nXaRdl5JUSjVF/ACXA8DW+vWPeyIL8z0e T6tqLjKSStZ/zsoN7/e5fBfgKYCh1Jk= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-528-w0vQSvcvOje6fbNYiRd3Fg-1; Wed, 27 Oct 2021 04:42:29 -0400 X-MC-Unique: w0vQSvcvOje6fbNYiRd3Fg-1 Received: by mail-lj1-f198.google.com with SMTP id f6-20020a2e9e86000000b00211349f9ce3so350723ljk.3 for ; Wed, 27 Oct 2021 01:42:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OOlw6qjWi33xj030By3H9sNLkrBuTCXW0LBQFCf2Ymc=; b=UlVsraHrTdbE6pj1wwTBSDriG9vsjz/LRMLBg5l70orS+2kbCcxOeI5ikFpwQ4mJTn IQAIZjZvlfWZqWyLvJoHDEcGcLJpj2BwlwYrnEifZGTy7IjqIJs6lyT2qTmAKfMoZRzL WHjPhfcY4EqIp0AXlURF4Ju4hV1dANQvcnmnw1VjEIMZNQA2gf7o9g6IK0bQIOE7tqAN J2cgzpu3H2WSWjIycBbaYqmIzAsFNIsUrEHMDoiUfmxaz+d6ZuD+Zk6JYU2CX24IZy6k jQF1q89F7Y+1GqWo/9CmoYcvUudGYzf7Kgv1znLxdDon3hdfSxToT9dTKy1OLRo+y41f 8AFg== X-Gm-Message-State: AOAM532wckmt/GUA2gFWgo1WJf6BLVihNuTu35jRckvfXrvLl2RgwQHh meBhfT85nPUDslcN5+cQYLsTDkuaMwF1Q7wBjtjxoyZHw17aD8aV85kGciK8gJ31mdpOq90XgKf EDimvT/Rj6Lzd+hN4CmA= X-Received: by 2002:a2e:7f1b:: with SMTP id a27mr10774281ljd.55.1635324147510; Wed, 27 Oct 2021 01:42:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVNIxpjlsCI4STCZ0PzRRyyBRqaNSN4HlAzpAGBhDQ4FRpUllQif8rhAKWKwnSBBVrpA+ktZ19dEtHatAql4Y= X-Received: by 2002:a2e:7f1b:: with SMTP id a27mr10774261ljd.55.1635324147311; Wed, 27 Oct 2021 01:42:27 -0700 (PDT) MIME-Version: 1.0 References: <20211026145851.21944-1-david.marchand@redhat.com> <3415992.2jfn0xn0IN@thomas> In-Reply-To: From: David Marchand Date: Wed, 27 Oct 2021 10:42:15 +0200 Message-ID: To: Olivier Matz Cc: Thomas Monjalon , dev , "Ananyev, Konstantin" , "Yigit, Ferruh" , Andrew Rybchenko , Bing Zhao , Xiaoyun Li 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] ethdev: warn only once for badly behaving applications 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 Sender: "dev" On Wed, Oct 27, 2021 at 10:16 AM Olivier Matz wrote: > > Do you have the explanation or can you point me at some standard > > explaining the difference in treatment? > > Let me try an explanation, hope it is the correct one. > > In the first case, this is an assignment as described in 6.5.16 of > the standard [1]: > > *fpo = (struct rte_eth_fp_ops) { .rx_pkt_burst = dummy_eth_rx_burst, ... }; > > The compiler expects the right side to be an expression. The expression > is a "compound literal", as described in 6.5.2.5: > > 1. The type name shall specify a complete object type or an array of > unknown size, but not avariable length array type. > 2. All the constraints for initializer lists in 6.7.9 also apply to > compound literals > > The second cast { ..., .rxq = (struct rte_ethdev_qdata) { ... } } is > inside a construction that behaves like an initialization (according to > the second point above). The compiler already knows the type of the > struct (and therefore the types of the fields), so the cast is not > required. > > [1] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf I read/understand it like this too. Thanks a lot, reading standards is always illuminating. -- David Marchand