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 A8564A00BE; Sun, 10 Apr 2022 15:52:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B33340685; Sun, 10 Apr 2022 15:52:51 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) by mails.dpdk.org (Postfix) with ESMTP id 786A540042 for ; Sun, 10 Apr 2022 15:52:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GV5g80xx1X0pCji+dhcs6LKRIMB7if7zFtQHDrMoBIRy1H2gaed79DR54jFms0ogbsYDiEnfzcUBy8euOC+XQ8HbiWN1WddlfDm7S1V1i+3LDmRxtXtLuGDOBl/WYUd4IaQJ4GpJ5FWIn78/3SEdiHKSsG+uEreKz4dCsRihy6oxfn/c91CP0PM+DzNwQmNy/LlmVWmN31gX1ORhX26rRJl63C+dm28LwUaYgsXYV1nnoKLWIqRFqJqmUgAq4B2AwFoFvNZyApQn6ei5OGBVAOa42DJha/hz7nf5eYBpat+TyqXo3A0dhcOnSUiqv8rRTBN4e+rCsGnW2WHsGsws2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sDAD7K0btR9DkGH+ZGLgNC8vzjsCRJN2/dL38FbKxAc=; b=Ohb0sIkvSY+HsbIeaCy3FTNYsaotblymLVGEFfnIs3tiJOkEjGFflbYGgWEKqLspDLoIe56B4yT/V6qdhd6hI7kNvgRduWieuUkoHFrLxMxZ2xFwmdyKz2YJ6CI3HwuoNDMM70HjcSQrzgho2vfOodu4hiSM/nRDcoUWEJ9/iZRE6bkvjYktqlZR7RMA1at5JStcJEICI2XTPqBviwSrBqX0EP0Lp40c0t+Uu5XoXHCiWSL7/ox7oBDJuyYeLTFw+CykTS5wT1Tc9S57QQNEIb9cYZSmwYp0aJagSKhm9HN3oWU6z2gcNJKVtGbXP+TJlkR8Y57L2ggsQHVkA4bFlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sDAD7K0btR9DkGH+ZGLgNC8vzjsCRJN2/dL38FbKxAc=; b=ulYS/ymZVvF8XSrl1NUPtvDk5Or3TPdN3r+sGb/YLQbDWAAcwaZ9nKmJ+TXg2H/3zVFIgMffojUmh1DWuOPc94U/LDai5j6QxLpPdeZzrgN5GFuhs6FrEnarWIDIoViOwbI2gGdKIBjDMPFLYuyUcTKrlMTT4+IOl1YQe3Aa8NE= Received: from AM5PR0601CA0046.eurprd06.prod.outlook.com (2603:10a6:203:68::32) by AM4PR0701MB2116.eurprd07.prod.outlook.com (2603:10a6:200:4a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.16; Sun, 10 Apr 2022 13:52:47 +0000 Received: from AM5EUR02FT072.eop-EUR02.prod.protection.outlook.com (2603:10a6:203:68:cafe::18) by AM5PR0601CA0046.outlook.office365.com (2603:10a6:203:68::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29 via Frontend Transport; Sun, 10 Apr 2022 13:52:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; Received: from oa.msg.ericsson.com (192.176.1.74) by AM5EUR02FT072.mail.protection.outlook.com (10.152.9.3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5144.20 via Frontend Transport; Sun, 10 Apr 2022 13:52:46 +0000 Received: from ESESSMB504.ericsson.se (153.88.183.165) by ESESBMR501.ericsson.se (153.88.183.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Sun, 10 Apr 2022 15:52:46 +0200 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.192) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Sun, 10 Apr 2022 15:52:46 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id 6D794601CB; Sun, 10 Apr 2022 15:52:46 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: Thomas Monjalon , David Marchand , , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [RFC 1/3] eal: add macro to warn for unused function return values Date: Sun, 10 Apr 2022 15:51:38 +0200 Message-ID: <20220410135140.161842-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62013b02-9a85-40f3-6f46-08da1af96505 X-MS-TrafficTypeDiagnostic: AM4PR0701MB2116:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BogITDHYEBWx4OVT/dJcUMMNafjt8KAd2HFWdyGq9u1KaWFN5ubVAaDe3Diq7F1NkglvtwRmRUkxWlC7UXQ6SzBWqKZtb++VIMWfilyF3WvqTIvyeZW9lKGzP8Dhmt6NazAQQEb6cGamphjsSaeU7rHiCQ6xEGAbtw2pmdTXFSWhvLfiYpD9M4Pw0I3z2Nukw+iAeEzWXnZX+rxT8tQV6x49164xcta14Cw7RN/nk50hGOzH0di0IiGumVLOT0M5gmcMY7eX9iTu0mQyy7WLcfi6cxL/54u8/BUHkWCgGLruufHtqeziizEBFLb/K7+fOH2M5sy6/h1Vf9tysVSi4YkvCPmBCvrM/TJk9fg7gwE57E0s1NOgpFu9I2tamn6qtTX2UI71Ph/5GVXQsTptPHSqFOgdv+GY7iws7+XFcb5q+rvm9rvasruuiO+j/kXe280Fv1Cv6LVZyRu6c8WBdhAbPCMqnJ6gtKaSN8LIwby3vPDRWLXNQYjHVAbISdoloEAijrI6U6hmB5KKNnQSnk6RpO9364Zkzub+JzYUfFh8lqyFP7A3vsoqULn3z2LG0SkuqJynsOiiYQLNG4hiQ2ErVGGfPA8sgYlH0wkuPFRkk0WFi8KkLbsHz3wdwtoT1vG2XVTMMM8vKXklnQG7hKj6sb9X8RBZvKf9/ZdpclIbVxQAd83+9s/tnPzHj2UrhB4G96VVOypBIxFbD/FKGA== X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(1076003)(107886003)(2616005)(34020700004)(70586007)(70206006)(83380400001)(8676002)(4326008)(336012)(26005)(186003)(6266002)(66574015)(86362001)(47076005)(508600001)(5660300002)(36756003)(54906003)(8936002)(82960400001)(4744005)(356005)(82310400005)(7636003)(316002)(36860700001)(40460700003)(6916009)(6666004)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2022 13:52:46.9599 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62013b02-9a85-40f3-6f46-08da1af96505 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR02FT072.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0701MB2116 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 This patch adds a wrapper macro __rte_warn_unused_result for the warn_unused_result function attribute. Marking a function __rte_warn_unused_result will make the compiler emit a warning in case the caller does not use the function's return value. Signed-off-by: Mattias Rönnblom --- lib/eal/include/rte_common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index 4a399cc7c8..544e7de2e7 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -222,6 +222,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) */ #define __rte_noreturn __attribute__((noreturn)) +/** + * Issue warning in case the function's return value is ignore + */ +#define __rte_warn_unused_result __attribute__((warn_unused_result)) + /** * Force a function to be inlined */ -- 2.25.1