git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix unused-parameter warnings with NO_ICONV
@ 2024-10-02  9:06 Mike Hommey
  2024-10-02  9:47 ` Kristoffer Haugsbakk
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Hommey @ 2024-10-02  9:06 UTC (permalink / raw)
  To: git; +Cc: peff, gitster, Mike Hommey

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
  2024-10-02  9:06 [PATCH] Fix unused-parameter warnings with NO_ICONV Mike Hommey
@ 2024-10-02  9:47 ` Kristoffer Haugsbakk
  2024-10-02 20:01   ` Mike Hommey
  0 siblings, 1 reply; 6+ messages in thread
From: Kristoffer Haugsbakk @ 2024-10-02  9:47 UTC (permalink / raw)
  To: Mike Hommey, git; +Cc: Jeff King, Junio C Hamano

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] Fix unused-parameter warnings with NO_ICONV
  2024-10-02  9:47 ` Kristoffer Haugsbakk
@ 2024-10-02 20:01   ` Mike Hommey
  2024-10-02 22:01     ` Jeff King
  2024-10-02 22:39     ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Hommey @ 2024-10-02 20:01 UTC (permalink / raw)
  To: git; +Cc: peff, gitster, Mike Hommey

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
  2024-10-02 20:01   ` Mike Hommey
@ 2024-10-02 22:01     ` Jeff King
  2024-10-03 21:02       ` Mike Hommey
  2024-10-02 22:39     ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff King @ 2024-10-02 22:01 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git, gitster

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
  2024-10-02 20:01   ` Mike Hommey
  2024-10-02 22:01     ` Jeff King
@ 2024-10-02 22:39     ` Junio C Hamano
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2024-10-02 22:39 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git, peff

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix unused-parameter warnings with NO_ICONV
  2024-10-02 22:01     ` Jeff King
@ 2024-10-03 21:02       ` Mike Hommey
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Hommey @ 2024-10-03 21:02 UTC (permalink / raw)
  To: Jeff King; +Cc: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-10-03 21:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-02  9:06 [PATCH] Fix unused-parameter warnings with NO_ICONV Mike Hommey
2024-10-02  9:47 ` Kristoffer Haugsbakk
2024-10-02 20:01   ` Mike Hommey
2024-10-02 22:01     ` Jeff King
2024-10-03 21:02       ` Mike Hommey
2024-10-02 22:39     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).