From patchwork Mon Mar 14 15:38:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 63826 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp108740lbc; Mon, 14 Mar 2016 08:38:50 -0700 (PDT) X-Received: by 10.98.80.22 with SMTP id e22mr30751730pfb.15.1457969930195; Mon, 14 Mar 2016 08:38:50 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id l8si15890677pfb.18.2016.03.14.08.38.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Mar 2016 08:38:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 542F31A1F34; Mon, 14 Mar 2016 08:39:07 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5A49F1A1EDD for ; Mon, 14 Mar 2016 08:39:05 -0700 (PDT) Received: by mail-wm0-x22a.google.com with SMTP id l68so107601762wml.0 for ; Mon, 14 Mar 2016 08:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=PLafbVilcVvNrxNBlcSOm40KS1c7U4QtVfmHq52w8y8=; b=ON2t9UAJKbxc3lpZIY3URNublR2pEJ6Z7Ajj47X0lhaL4xk+dK8Y5p4N9KrwTqP2qK f58jKl1e6RxoOJIf5M6zXD2oJpSQsM8FTe2XIcimAuZ8WR1+uLMPGGuwXhuL9HXOJEht xzDG2jWOlG4X6dSQrNkYrLRsHa61KG9vdh6Gk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PLafbVilcVvNrxNBlcSOm40KS1c7U4QtVfmHq52w8y8=; b=AB8wIKGqrsU7WmBx7F5S3WruhMj/fBhy2ylB7N/FlCa+rSN8LEV/Ywv4VloTze//Vr 4Ew9t7IEIALCiqM+IsfT+61TgAkjwoRs4pGzYokpF4a7Ixtbmd04Je9gX1yH6qdeyeFH /S3zX3x9ot6qPyEYlByUXuizFnyBSpQGKxq9kuR0ytA3OEZxAA/uh05sJ5e2/S+BzUsW /PxlbAvFbbfTlG7u9/qy+j6AYaftkeOgWz8PLaebvUNFfv837mWsu4Je/cwVgHAgtB61 6UZ4JQTJMJBJLwHG0He41UFPWi8c9lTp33m5O2ujOFq0/ivjPCnjklG8MUulR0Xnj5tn jehQ== X-Gm-Message-State: AD7BkJLACKZQlyPDO1fbGjWi/gnd6pTynSTpJAQv/c3EBERPKMgt6p2PA4iUBjpL810VfMQT X-Received: by 10.194.60.100 with SMTP id g4mr24715178wjr.30.1457969926110; Mon, 14 Mar 2016 08:38:46 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc92308-cmbg19-2-0-cust814.5-4.cable.virginm.net. [82.24.251.47]) by smtp.gmail.com with ESMTPSA id o16sm22957689wjr.9.2016.03.14.08.38.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Mar 2016 08:38:45 -0700 (PDT) From: Leif Lindholm To: edk2-devel@lists.01.org Date: Mon, 14 Mar 2016 15:38:41 +0000 Message-Id: <1457969921-29870-1-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.1.4 Cc: Michael D Kinney , Liming Gao Subject: [edk2] [RFC] MdePkg: add ARG_UNUSED notation to Base.h X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" To permit many existing platforms to build with -Wunused-parameter, on GCC and CLANG, the unused parameters need to be annotated as such. Existing regexp code already uses ARG_UNUSED for this, but it is really needed across the codebase - so add a version in Base.h. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm --- This is really the result of a friendly toolchain engineer informing me CLANG has the -Weverything flag, to actually enable all possible warnings. One problem trying to pick out the real bugs from the just not entirely clear code is that basically a lot of *LibNull implementations, and some libraries that should be usable, trip build failures due to unused parameters. MdePkg/Include/Base.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.1.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Acked-by: Laszlo Ersek diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 89b2aed..f789094 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -189,6 +189,15 @@ struct _LIST_ENTRY { /// #define OPTIONAL +/// +/// Function argument intentionally unused in function. +/// +#if defined(__GNUC__) || defined(__clang__) + #define ARG_UNUSED __attribute__ ((unused)) +#else + #define ARG_UNUSED +#endif + // // UEFI specification claims 1 and 0. We are concerned about the // complier portability so we did it this way.