From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 298A81F403 for ; Tue, 18 Oct 2022 01:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231203AbiJRBFw (ORCPT ); Mon, 17 Oct 2022 21:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbiJRBFm (ORCPT ); Mon, 17 Oct 2022 21:05:42 -0400 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BF56857FA for ; Mon, 17 Oct 2022 18:05:29 -0700 (PDT) Received: (qmail 28784 invoked by uid 109); 18 Oct 2022 01:05:29 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 18 Oct 2022 01:05:29 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13457 invoked by uid 111); 18 Oct 2022 01:05:30 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Mon, 17 Oct 2022 21:05:30 -0400 Authentication-Results: peff.net; auth=none Date: Mon, 17 Oct 2022 21:05:28 -0400 From: Jeff King To: git@vger.kernel.org Subject: [PATCH 05/12] object-file: mark unused parameters in hash_unknown functions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The 0'th entry of our hash_algos array fills out the virtual methods with a series of functions which simply BUG(). This is the right thing to do, since the point is to catch use of an invalid algo parameter, but we need to annotate them to appease -Wunused-parameters. Signed-off-by: Jeff King --- object-file.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/object-file.c b/object-file.c index 5e30960234..957790098f 100644 --- a/object-file.c +++ b/object-file.c @@ -140,27 +140,32 @@ static void git_hash_sha256_final_oid(struct object_id *oid, git_hash_ctx *ctx) oid->algo = GIT_HASH_SHA256; } -static void git_hash_unknown_init(git_hash_ctx *ctx) +static void git_hash_unknown_init(git_hash_ctx *ctx UNUSED) { BUG("trying to init unknown hash"); } -static void git_hash_unknown_clone(git_hash_ctx *dst, const git_hash_ctx *src) +static void git_hash_unknown_clone(git_hash_ctx *dst UNUSED, + const git_hash_ctx *src UNUSED) { BUG("trying to clone unknown hash"); } -static void git_hash_unknown_update(git_hash_ctx *ctx, const void *data, size_t len) +static void git_hash_unknown_update(git_hash_ctx *ctx UNUSED, + const void *data UNUSED, + size_t len UNUSED) { BUG("trying to update unknown hash"); } -static void git_hash_unknown_final(unsigned char *hash, git_hash_ctx *ctx) +static void git_hash_unknown_final(unsigned char *hash UNUSED, + git_hash_ctx *ctx UNUSED) { BUG("trying to finalize unknown hash"); } -static void git_hash_unknown_final_oid(struct object_id *oid, git_hash_ctx *ctx) +static void git_hash_unknown_final_oid(struct object_id *oid UNUSED, + git_hash_ctx *ctx UNUSED) { BUG("trying to finalize unknown hash"); } -- 2.38.0.371.g300879f34e