From d8eba881c802082f3c775f00f115b2273b30a641 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 3 Dec 2019 16:07:44 -0500 Subject: [PATCH] Cleanup: silence unused parameter `ps` warning 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 Signed-off-by: Mathieu Desnoyers Change-Id: I09f4fd3938058ed985c1525d8b9b06a27529691e --- snprintf/mbrtowc_sb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snprintf/mbrtowc_sb.c b/snprintf/mbrtowc_sb.c index 0abecc8e..3a81931f 100644 --- a/snprintf/mbrtowc_sb.c +++ b/snprintf/mbrtowc_sb.c @@ -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 */ -- 2.34.1