# [PATCH] Fix unused-parameter warnings with NO_ICONV

6 messages from 2024-10-02 to 2024-10-03. Participants: Mike Hommey, Kristoffer Haugsbakk, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/62234

## Mike Hommey, 2024-10-02 09:06

Subject: [PATCH] Fix unused-parameter warnings with NO_ICONV
Message-ID: <20241002090606.2076645-1-mh@glandium.org>
URL: https://gitlist.dev/e/20241002090606.2076645-1-mh%40glandium.org

```
The jk/unused-parameters topic enabled -Wunused-parameter. Some code in
some non-typical configuration lacked annotations.
---
 utf8.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/utf8.h b/utf8.h
index fcd5167baf..cce299d274 100644
--- a/utf8.h
+++ b/utf8.h
@@ -33,8 +33,9 @@ char *reencode_string_len(const char *in, size_t insz,
 			  const char *in_encoding,
 			  size_t *outsz);
 #else
-static inline char *reencode_string_len(const char *a, size_t b,
-					const char *c, const char *d, size_t *e)
+static inline char *reencode_string_len(const char *a UNUSED, size_t b UNUSED,
+					const char *c UNUSED,
+					const char *d UNUSED, size_t *e)
 { if (e) *e = 0; return NULL; }
 #endif
 
-- 
2.46.1.1.gad55fb22ef


```

## Kristoffer Haugsbakk, 2024-10-02 09:47

Subject: Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
Message-ID: <cec3d068-38d3-4802-b2d0-77644dd425c3@app.fastmail.com>
URL: https://gitlist.dev/e/cec3d068-38d3-4802-b2d0-77644dd425c3%40app.fastmail.com
In-Reply-To: <20241002090606.2076645-1-mh@glandium.org>

```
On Wed, Oct 2, 2024, at 11:06, Mike Hommey wrote:
> The jk/unused-parameters topic enabled -Wunused-parameter. Some code in
> some non-typical configuration lacked annotations.

You forgot the sign-off.

-- 
Kristoffer Haugsbakk

```

## Mike Hommey, 2024-10-02 20:01

Subject: [PATCH] Fix unused-parameter warnings with NO_ICONV
Message-ID: <20241002200140.2123584-1-mh@glandium.org>
URL: https://gitlist.dev/e/20241002200140.2123584-1-mh%40glandium.org
In-Reply-To: <cec3d068-38d3-4802-b2d0-77644dd425c3@app.fastmail.com>

```
The jk/unused-parameters topic enabled -Wunused-parameter. Some code in
some non-typical configuration lacked annotations.

Signed-off-by: Mike Hommey <mh@glandium.org>
---
 utf8.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/utf8.h b/utf8.h
index fcd5167baf..cce299d274 100644
--- a/utf8.h
+++ b/utf8.h
@@ -33,8 +33,9 @@ char *reencode_string_len(const char *in, size_t insz,
 			  const char *in_encoding,
 			  size_t *outsz);
 #else
-static inline char *reencode_string_len(const char *a, size_t b,
-					const char *c, const char *d, size_t *e)
+static inline char *reencode_string_len(const char *a UNUSED, size_t b UNUSED,
+					const char *c UNUSED,
+					const char *d UNUSED, size_t *e)
 { if (e) *e = 0; return NULL; }
 #endif
 
-- 
2.46.1.1.gad55fb22ef


```

## Jeff King, 2024-10-02 22:01

Subject: Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
Message-ID: <20241002220118.GA2892418@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20241002220118.GA2892418%40coredump.intra.peff.net
In-Reply-To: <20241002200140.2123584-1-mh@glandium.org>

```
On Thu, Oct 03, 2024 at 05:01:40AM +0900, Mike Hommey wrote:

> The jk/unused-parameters topic enabled -Wunused-parameter. Some code in
> some non-typical configuration lacked annotations.

Thanks, this looks good. I tried to catch compile-time variants like
this, but I was mostly limited to what we build in CI.

Out of curiosity, what platform do you use that needs NO_ICONV (or is it
just a preference)?

-Peff

```

## Junio C Hamano, 2024-10-02 22:39

Subject: Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
Message-ID: <xmqq4j5uku3l.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq4j5uku3l.fsf%40gitster.g
In-Reply-To: <20241002200140.2123584-1-mh@glandium.org>

```
Mike Hommey <mh@glandium.org> writes:

> The jk/unused-parameters topic enabled -Wunused-parameter. Some code in
> some non-typical configuration lacked annotations.
>
> Signed-off-by: Mike Hommey <mh@glandium.org>
> ---
>  utf8.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Thanks.

> diff --git a/utf8.h b/utf8.h
> index fcd5167baf..cce299d274 100644
> --- a/utf8.h
> +++ b/utf8.h
> @@ -33,8 +33,9 @@ char *reencode_string_len(const char *in, size_t insz,
>  			  const char *in_encoding,
>  			  size_t *outsz);
>  #else
> -static inline char *reencode_string_len(const char *a, size_t b,
> -					const char *c, const char *d, size_t *e)
> +static inline char *reencode_string_len(const char *a UNUSED, size_t b UNUSED,
> +					const char *c UNUSED,
> +					const char *d UNUSED, size_t *e)
>  { if (e) *e = 0; return NULL; }
>  #endif

```

## Mike Hommey, 2024-10-03 21:02

Subject: Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
Message-ID: <20241003210229.g4yzbs2xh276xmdk@glandium.org>
URL: https://gitlist.dev/e/20241003210229.g4yzbs2xh276xmdk%40glandium.org
In-Reply-To: <20241002220118.GA2892418@coredump.intra.peff.net>

```
On Wed, Oct 02, 2024 at 06:01:18PM -0400, Jeff King wrote:
> On Thu, Oct 03, 2024 at 05:01:40AM +0900, Mike Hommey wrote:
> 
> > The jk/unused-parameters topic enabled -Wunused-parameter. Some code in
> > some non-typical configuration lacked annotations.
> 
> Thanks, this looks good. I tried to catch compile-time variants like
> this, but I was mostly limited to what we build in CI.
> 
> Out of curiosity, what platform do you use that needs NO_ICONV (or is it
> just a preference)?

I'm just using parts of libgit.a and don't need the iconv support so I
disable it. That avoids a dependency on the iconv dll on Windows.

Mike

```
