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 70452A0352; Mon, 31 Jan 2022 01:05:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0056410E1; Mon, 31 Jan 2022 01:05:37 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 9236640E25 for ; Mon, 31 Jan 2022 01:05:36 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id d5so12253057pjk.5 for ; Sun, 30 Jan 2022 16:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xWY1zfdhYcyLrtiHRYazzUb24f0ZwWlEHNuvgHHPfz4=; b=L6X6Vrr2GYaDVlQyXCvCKFXO0v8keIfKklweqE7Olw2hA3oHSBLzBGLajfw/jJEdvu lH6OdMmo2CQ83PlAGkoma6evflz842DqfiRveCVpKTyqhZ01sK3NIPUsfe4zKMBrGFKO hMD/RO9DpCX+IcJUlrj12P3gowIKqSYpJf7A+9hiRbK0opzRG4pVPE7eFxFBwtjEdk9I Wk9HHYayVevQM0FiNsEEcdUf3CpdnqjwxnyBdl7bFCis6bp5q2h0jMeYA73EXT37cI9/ gh11r/mSMUwAfgOnp99MeamXM95lYLRd0CC8GQJvD/J/2k0MOuVHAiCn3Jhr4ixoWiNw oskg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xWY1zfdhYcyLrtiHRYazzUb24f0ZwWlEHNuvgHHPfz4=; b=jd9ovg3SVjOtBSsS2cfRgZufxZs3vzz0zD26SM3ZtqMBOuoEh4r/I0+XCWg1UV6Osx imyWtVscdX+CTYU+pV58f9FzCE3qzxgWYrUv6ekMiTBEYMBQ2VVvcW07Q83GiAtDX8LK /nLvrGwd92HUmR3QixxinDZuVY5i+ja7ilqB/YgesnNuAUgpJevAmGQwnoRo7ZPNIPyz sFbuLR1kiL/Lbc7e06DdEg1Ch1vpZP7Fh3N22Y3o+Qm5GQdFYffXDn1+jpNrjJx8ejtj JtSXbarrBzmvrYGqPPBKkZ87ZpLYVJC/wY1JNN0GT8XVyrIjB8Lhec8eax4TG+1xsKOq zbOA== X-Gm-Message-State: AOAM531cy1IUQwktkmiZQbWbHLVz3GC3M1+GDccHitcDGONeJ0ILkZEn 4F21aJZNYKHIhX6lmJGFNo5zU5cgll4KFg== X-Google-Smtp-Source: ABdhPJzvAhT14v+6DN863IWhJ4OpsGYuFpfPvWV7nVOvjkF3BYfFGClhPZTnmZyb5eG3dfOs9IHYIw== X-Received: by 2002:a17:902:d2d2:: with SMTP id n18mr18584113plc.0.1643587535522; Sun, 30 Jan 2022 16:05:35 -0800 (PST) Received: from plinth.fritz.box ([151.210.134.32]) by smtp.googlemail.com with ESMTPSA id ga21sm5283252pjb.2.2022.01.30.16.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 16:05:35 -0800 (PST) From: Michael Barker To: dev@dpdk.org Cc: Michael Barker , Ray Kinsella Subject: [PATCH v5] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if. Date: Mon, 31 Jan 2022 13:05:16 +1300 Message-Id: <20220131000516.76727-1-mikeb01@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220123212024.19747-1-mikeb01@gmail.com> References: <20220123212024.19747-1-mikeb01@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 When compiling with clang using -Wpedantic (or -Wgcc-compat) the use of diagnose_if kicks up a warning: .../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang extension [-Werror,-Wgcc-compat] __rte_internal ^ .../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal' __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ This change ignores the '-Wgcc-compat' warning in the specific location where the warning occurs. It is safe to do in this circumstance as the specific macro is only defined when using the clang compiler. Signed-off-by: Michael Barker --- lib/eal/include/rte_compat.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/eal/include/rte_compat.h b/lib/eal/include/rte_compat.h index 2718612cce..9556bbf4d0 100644 --- a/lib/eal/include/rte_compat.h +++ 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 */ #define __rte_internal \ +_Pragma("GCC diagnostic push") \ +_Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \ __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ -section(".text.internal"))) +section(".text.internal"))) \ +_Pragma("GCC diagnostic pop") #else -- 2.25.1