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 434A1A0352; Mon, 31 Jan 2022 01:11:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD80D41147; Mon, 31 Jan 2022 01:11:00 +0100 (CET) Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com [209.85.221.180]) by mails.dpdk.org (Postfix) with ESMTP id 65D8040E25 for ; Mon, 31 Jan 2022 01:10:59 +0100 (CET) Received: by mail-vk1-f180.google.com with SMTP id o15so7289726vki.2 for ; Sun, 30 Jan 2022 16:10:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8GP75zBdPDSCuKZw8zmOXYOM0rHZmSNLFhT68gnFEAQ=; b=oOvk/l0v/DgKfrs9r5ZZv1OY+J2ZXUFtDEzmLJQfk9TWh1GLKn8znd/qDBgRlvasv+ nUHzsEEuTkVnKdLxKD6el6eWoR5rUmlE3tpzfBuTXE1Ptjs2T56K3Ac87mJyJMH/donf JqOd2UmSZhU1/E61B8PQy4McVFQjQNmvLI7rzNFAZqfgp3hbobBKjGlhrKjySFTGSZPA TDzsLDil8TQAI2KEAIpNy40r7aRIO7+ngmK68UP7lanBla+rkUiVP4HuW8CRy+8lAUoB hW2GGOJS55rPj3Dloj8/ljeJb3ZF+CndQ9XzVLZV1+cH2BJGq1VM1pdlJIpFh7ro4dLJ wd3g== 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=8GP75zBdPDSCuKZw8zmOXYOM0rHZmSNLFhT68gnFEAQ=; b=pFRTO6GzBDGK2eo7XprE4m1c/64JrxDuEf3J3IVJuVtvDkmniWuEBwEpb/RWPA9brx vbyMU8NpV3NfTXqT00g1ttA5DyUD2jiGhBZZ2sni1eVGk0397DRPXaziUQQWM2kGRJxZ 34KAJ8Ar365ZwWe9mRqlVC7/3XUcINooLDVAOqHNqhzJyq0qnfwmobnVj5cPmZe93nYt 9easo3ZRfTVUCKjj0yFcjEHW28XY4DD15kh6Bh5amz/yfSAfaasOFeNNRnxifKpV+Hl/ 6Ccnr8y/ClN637d/v4DvFYpTWVwO4AtJ/vuRTNljFfBpzDHnpsKS0H2ZqgHcUn7V/8GK YmJg== X-Gm-Message-State: AOAM533g5dtbkhcYK5JsrQOusM4jj1qIlNjjfTdzUX3msrgslu2/Z/rk RqolD697V0pwSYZM6Qv7efBnv46EmoCOtPPNakg= X-Google-Smtp-Source: ABdhPJyUW5iKRSALvZo9K641KKVjWQuYfYxgl5hEowJ+oc/abx5y/pXOD99JAMmnoJ9M/HhXE0Yt1mlgUcS0cOpQR8E= X-Received: by 2002:a05:6122:209f:: with SMTP id i31mr7371157vkd.3.1643587858824; Sun, 30 Jan 2022 16:10:58 -0800 (PST) MIME-Version: 1.0 References: <20220123210751.19182-1-mikeb01@gmail.com> <20220123212024.19747-1-mikeb01@gmail.com> <87h79srtp9.fsf@mdr78.vserver.site> In-Reply-To: <87h79srtp9.fsf@mdr78.vserver.site> From: Michael Barker Date: Mon, 31 Jan 2022 13:10:47 +1300 Message-ID: Subject: Re: [PATCH v4] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if. To: Ray Kinsella Cc: Stephen Hemminger , dev@dpdk.org Content-Type: multipart/alternative; boundary="0000000000007b860905d6d59ec5" 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 --0000000000007b860905d6d59ec5 Content-Type: text/plain; charset="UTF-8" > > > +++ b/lib/eal/include/rte_compat.h > > @@ -33,8 +33,11 @@ section(".text.internal"))) > > #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* > > For clang */ > > Why doesn't the __has_attribute take care of this? > I would have thought that gcc would check the for the attribute, find it > doesn't support it and ignore the whole thing? > It appears that the '-Wgcc-compat' check is too naive and doesn't pick up the `__has_attribute` or `#if __clang__` and realise that there isn't really a compatibility issue with the code. Mike. --0000000000007b860905d6d59ec5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> +++ b/lib/eal/include/rte_compat.h
> @@ -33,8 +33,11 @@ section(".text.internal")))
>=C2=A0 #elif !defined ALLOW_INTERNAL_API && __has_attribute(dia= gnose_if) /*
> For clang */

Why doesn't the __has_attribute take care of this?
I would have thought that gcc would check the for the attribute, find it doesn't support it and ignore the whole thing?
It appears th= at the '-Wgcc-compat' check is too naive and doesn't pick up th= e `__has_attribute` or `#if __clang__` and realise that there isn't rea= lly a compatibility issue with the code.

Mike.

--0000000000007b860905d6d59ec5--