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 5CA1CA00C3; Tue, 18 Jan 2022 00:23:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E94CB40DF5; Tue, 18 Jan 2022 00:23:43 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id F1AE240140 for ; Tue, 18 Jan 2022 00:23:42 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id u11so17574508plh.13 for ; Mon, 17 Jan 2022 15:23:42 -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=OPAvJEzQeyR6fOzzEg6yFMeAoQX89yEdWVcndQ2nPVs=; b=qiFDsRcQkyi49mreUQU9NUbk6SAz4pQxOhoyVq2aaNqIx0Al1v6pl0RgemOpf/iTuF w+G7JqdGM6P3U5k+RYzTNHLgaYEqE2z91SEKSgRFau+p9Onn/nQhFXpya3sNlYNTUFwj 4BOHA5N1Z8UekAa4Cd8+ul1Yh7Rgjtrw9JeqvSU7znbDrB7K9GvgjP/+PN7PFauFcmG8 zNfzjsa4ckQSPFU7TZZ5uCY+oHQmKDLlDUslqrrJ034vvu197OBaXB4pS1SKlqO2wq1a ehIZm4QE6JFrV58284M9fxe6x1nwymNhmcRrGkmEdhIVN5XVkB1H4NjrivjABGZULdEM qYxg== 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=OPAvJEzQeyR6fOzzEg6yFMeAoQX89yEdWVcndQ2nPVs=; b=EnRPtUXmPTw2pw/RC5sewLJLBWhHIZ96qaSeoOLNTrEKsgswCBGzjtc/fU4Xj2/w4O 4QtukHLIFknPA7Ft8Z5PnU0esx5RJ6BcNUA1Q/fhxDEO0lTR+fPvLwQKduIiECe6gFpo Vfry1fF276uwvnHerqgyXP5qVggXJjelt0tDNrvAnfNdSmA/PHefZ4U872aiERyWHlO4 9n/qaErOanT0P5OPLYl81HV8v+uPVQ6+5T+ZWOCAatoW7EzsIqsl1U7J7FvK01kVNiGI Y1oR5Ye+JogmJ7ls/MfWzTqUArHVpSHofJ0BrzHSE7yBilYx8CxQ6sGBXwRR7po22R6A xCvw== X-Gm-Message-State: AOAM530WPXywRxB3t39Wx+Umg3IC7yrIwRElmuhaHFKJu7zNnwQRi/rG ANUsfgKx9xYJlEkBt6wreAwPCyVh4Y6QeQ== X-Google-Smtp-Source: ABdhPJwj6yGPLP9wXjVsrKw/2+T0ls1Qme9eeSwK53MB1aWq0DbkY9ZnWA2GVjRETnK3LF/h6xBB/g== X-Received: by 2002:a17:90a:4f0d:: with SMTP id p13mr12018410pjh.57.1642461821869; Mon, 17 Jan 2022 15:23:41 -0800 (PST) Received: from plinth.fritz.box ([151.210.134.32]) by smtp.googlemail.com with ESMTPSA id k2sm12830844pgh.11.2022.01.17.15.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 15:23:41 -0800 (PST) From: Michael Barker To: dev@dpdk.org Cc: Michael Barker , Ray Kinsella Subject: [PATCH v2] Add pragma to ignore gcc-compat warnings in clang when used with diagnose_if. Date: Tue, 18 Jan 2022 12:23:18 +1300 Message-Id: <20220117232318.219749-1-mikeb01@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220117231404.219496-1-mikeb01@gmail.com> References: <20220117231404.219496-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 using clang with -Wall the use of diagnose_if kicks up a warning, requiring all dpdk includes to be wrapped with the pragma. This change isolates the ignore just the appropriate location and makes it easier for users to apply -Wall,-Werror 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