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 6B079A04A7; Sun, 23 Jan 2022 22:20:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0C80427A2; Sun, 23 Jan 2022 22:20:50 +0100 (CET) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id 197E040040 for ; Sun, 23 Jan 2022 22:20:49 +0100 (CET) Received: by mail-pg1-f182.google.com with SMTP id z131so2354435pgz.12 for ; Sun, 23 Jan 2022 13:20:49 -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=e+qsAQ1Jm/ETilb+65iiCyh/9e3z5dLDxQEhkFjO04c=; b=gr1z/8Nl53luD4B5h/S8K62Fk8aRJP4rNUjBoJNQpu4TUQqRD58Q1oC03FUULZhLwQ WvvFPEovKVaHMohibSBqeMsUZGo2Kyvg6Y23+CnqgDvKzVhj73HPQ8rSo88gh6fAFUad dvEhgZCFKtzQrIKmh+CSgW8kuPnS2PNysrqWgc222HfK3b1gHFGiai4XmnPo9BA3D1LI oE7W6Sf+ibJX/y4tXJrPMp7P/FQzvy3n5sAflpUye48/HgEHQm7JxyI3o+tTnE7mkBKy AtY+gP4nz7kHbfYctLgt7R165H9aQB+CmjEX9uCJ+rF8m+PijhKeoz09osYGBRWFZPmp MH4Q== 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=e+qsAQ1Jm/ETilb+65iiCyh/9e3z5dLDxQEhkFjO04c=; b=og3sQ041Ut7mrzOZb7w14QlDJP9IdvVkOSUkECLvjxU57iLAIfhO09d07coR1b3Idk +zmD8mN6XZFNyKNPueE1XZMIyRLEckAdfspocVp50CBYN63uEjyBfzCmK5ARTTtBp0Sl frvp4yRoXyeV2tWVFPSp7rBGVcn7prJC9XuvTTYCOmfkUsHv8SfcX8xFTPBdFk2hKr/c 2enZDqsPOJSe7VD4k4A8lA4gWk6psNhT8VkencBCqOlt6vxPEudRffrC+POuwq+8H/jZ PzwwwxMrBl7g2nqYmPRUPasHG70uYpsXm/J1yADTMS7BzxGaaC3zXJmdwepl+9k6AfWK l2lw== X-Gm-Message-State: AOAM530DEZus0ilkUNVNvoDf48D1yX8gmze9X4KLY7LPEzZd3g/5zaW/ 4ch0wXUcuIJtY/tkhd8o2d2fZR4yx3bZcA== X-Google-Smtp-Source: ABdhPJz1SC1UEJPnoKk8qxQJPCBZuHqROVLA1+B4YNjg08pe//9fNiDQWJ2ZquNwgdKxR2Bo4SgUPw== X-Received: by 2002:a63:a84b:: with SMTP id i11mr9627579pgp.486.1642972848068; Sun, 23 Jan 2022 13:20:48 -0800 (PST) Received: from plinth.fritz.box ([151.210.134.32]) by smtp.googlemail.com with ESMTPSA id q12sm3979440pfk.199.2022.01.23.13.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 13:20:47 -0800 (PST) From: Michael Barker To: dev@dpdk.org Cc: Michael Barker , Ray Kinsella Subject: [PATCH v4] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if. Date: Mon, 24 Jan 2022 10:20:24 +1300 Message-Id: <20220123212024.19747-1-mikeb01@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220123210751.19182-1-mikeb01@gmail.com> References: <20220123210751.19182-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