Cleanup: silence unused parameter `ps` warning
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 3 Dec 2019 21:07:44 +0000 (16:07 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Feb 2020 17:11:08 +0000 (12:11 -0500)
This function was copied here from one of the BSDs by this commit:
e5bc3b0f4d6c0407492ebdea863483925393e1bc with the /*ARGSUSED*/
lint-style comment to prevent any `unused` warning.

It seems clang doesn't support those lint-style comments, so it prints
this warning:
  CC       libustsnprintf_la-core.lo
  mbrtowc_sb.c:39:68: error: unused parameter 'ps' [-Werror,-Wunused-parameter]
  ust_safe_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)

So mark that parameter as unused to prevent any warning.

We could also simply remove the unused parameter and change the
signature of the function.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I09f4fd3938058ed985c1525d8b9b06a27529691e

snprintf/mbrtowc_sb.c

index 0abecc8e112a948cd8b34e3dba29678a1bcba12d..3a81931fd8f54ca53a8647ab6764e7bba6f669c1 100644 (file)
@@ -36,7 +36,8 @@
 
 /*ARGSUSED*/
 size_t
-ust_safe_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
+ust_safe_mbrtowc(wchar_t *pwc, const char *s, size_t n,
+               mbstate_t *ps __attribute__((unused)))
 {
 
        /* pwc may be NULL */
This page took 0.02471 seconds and 4 git commands to generate.