Browse Source

libc: Fix some unused parameter warnings

Sven Linker 2 months ago
parent
commit
0f4669a6ec

+ 3 - 0
libc/inet/getnet.c

@@ -69,6 +69,7 @@ int getnetent_r(struct netent *result_buf,
 	char **tok = NULL;
 	const size_t aliaslen = sizeof(char *) * MAXTOKENS;
 	int ret = ERANGE;
+	(void)h_errnop;
 
 	*result = NULL;
 	if (buflen < aliaslen
@@ -147,6 +148,7 @@ int getnetbyname_r(const char *name,
 {
 	register char **cp;
 	int ret, herrnop;
+	(void)h_errnop;
 
 	__UCLIBC_MUTEX_LOCK(mylock);
 	setnetent(net_stayopen);
@@ -181,6 +183,7 @@ int getnetbyaddr_r(uint32_t net, int type,
 					int *h_errnop)
 {
 	int ret, herrnop;
+	(void)h_errnop;
 
 	__UCLIBC_MUTEX_LOCK(mylock);
 	setnetent(net_stayopen);

+ 2 - 1
libc/misc/internals/__uClibc_main.c

@@ -109,7 +109,7 @@ void internal_function _dl_aux_init (ElfW(auxv_t) *av);
  * in or linker will disregard these weaks.
  */
 
-static int __pthread_return_0 (pthread_mutex_t *unused) { return 0; }
+static int __pthread_return_0 (pthread_mutex_t *unused) { (void)unused; return 0; }
 weak_alias (__pthread_return_0, __pthread_mutex_lock)
 weak_alias (__pthread_return_0, __pthread_mutex_trylock)
 weak_alias (__pthread_return_0, __pthread_mutex_unlock)
@@ -117,6 +117,7 @@ weak_alias (__pthread_return_0, __pthread_mutex_unlock)
 int weak_function
 __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
 {
+        (void)mutex; (void)attr;
         return 0;
 }
 

+ 1 - 0
libc/misc/wchar/wchar.c

@@ -781,6 +781,7 @@ size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
 	size_t count;
 	int incr;
 	char buf[MB_LEN_MAX];
+	(void)ps;
 
 #ifdef __CTYPE_HAS_UTF_8_LOCALES
 	if (ENCODING == __ctype_encoding_utf8) {

+ 1 - 0
libc/stdlib/malloc-standard/malloc.c

@@ -176,6 +176,7 @@ void __do_check_remalloced_chunk(mchunkptr p, size_t s)
     size_t sz = p->size & ~PREV_INUSE;
 #endif
 
+    (void)s;
     __do_check_inuse_chunk(p);
 
     /* Legal size ... */