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 B519EA04A5; Sun, 23 Jan 2022 22:08:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E2694279D; Sun, 23 Jan 2022 22:08:23 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 80E0A40040 for ; Sun, 23 Jan 2022 22:08:22 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id y27so9850693pfa.0 for ; Sun, 23 Jan 2022 13:08:22 -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=PlAiXpR0OIGkvQ5jyEfmiIhfdb/TnZQqtmdiG0BEl6M=; b=iMhquIbTI0uCRHcrKg25sLJ4rgbs9gDAYrH5RvIim1ivZXJ127ioBIU+6FTJygxiyP +XNOCo7QzeOiCzauyRCs9M1rnzGF7+K/78NF2b/1ltwIuWFDnac9TEGiyuN1P6n83iRG LqbAuSwQ6xvSMwgYGTwNqrvrKjo1plOkagfrrumMg3nxgC0PPgSx5ziInNKdEBOKUdQP /VnEs6P0W4TTIkAiOYaomUNAVvJB8NT4sYbbeoeD0HqzY1BCoawhGAY+FolZ5LUaxrtl Q6rRS4PzKco//ryz3SWJRPWsptzUEjkx9D3OJlTeLyvu7aAPUDVvr/NTPza6uTXZtPuI XF/g== 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=PlAiXpR0OIGkvQ5jyEfmiIhfdb/TnZQqtmdiG0BEl6M=; b=LH7biA5UkETyRq2LpWDRkI/pHzFQ1hgzNsuFIv+gWGMgtwUiSH4j27/U4jiaeWB6Ht 7nXk5kRBR0aaLnBVoApIxtrvh4FOkU5/a0fXGplyV6F2bcefpI0hTfTw4StEfdTrnz3q MkCkJTuAv0OyTQvkpIGqG2NDGn8qrLzyOjtleDDx5/3UOqO0W3jkTuAGZwc1okimMeDq UoU1VhZoNsYmILXMWwGENLzMWgBL+QHZCgolDWwcAPAHNO5OApTWg7zF/AoMrTbOwl1U i9j3VOoBLkTdT5VX1hIEEZHd6It8Eo6rtycbpJGhlqbz0kRIhjNB6pI7xasa3Z6FB/I/ 5aDQ== X-Gm-Message-State: AOAM531v4+2RqAz2b2R8E+UYmu8plsVNcxeDd8wLxFo0Unp1LulGQ0da /vYb03q53lwjy6JV+b7l6kPKPr8qkSuT+Q== X-Google-Smtp-Source: ABdhPJyhfvA7tfYkeoPAZ8sEF39apKFbY638AkW/hjtoLwYDsgNdEwQBlKi9EC5cJfNhF+H5cvdFdQ== X-Received: by 2002:a05:6a00:1591:b0:4c9:257a:b6a3 with SMTP id u17-20020a056a00159100b004c9257ab6a3mr2084922pfk.12.1642972101276; Sun, 23 Jan 2022 13:08:21 -0800 (PST) Received: from plinth.fritz.box ([151.210.134.32]) by smtp.googlemail.com with ESMTPSA id l22sm13688019pfc.191.2022.01.23.13.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 13:08:20 -0800 (PST) From: Michael Barker To: dev@dpdk.org Cc: Michael Barker , Ray Kinsella Subject: [PATCH v3] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if. Date: Mon, 24 Jan 2022 10:07:51 +1300 Message-Id: <20220123210751.19182-1-mikeb01@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117232318.219749-1-mikeb01@gmail.com> References: <20220117232318.219749-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 -Wall (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