[PATCH] Silence -Wold-style-definition warnings

Kimplul <[email protected]> Thu, 12 Feb 2026 21:53:13 +0200
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
From: Kim Kuparinen <[email protected]>

Hi, I noticed that there were a few warnings about old-style function
definitions. I saw some other patches fixing the same warning, so this just
continues on from them. Now everything compiles neatly on my machine at least :)

Signed-off-by: Kim Kuparinen <[email protected]>
---
 newlib/libc/reent/closer.c     | 4 +---
 newlib/libc/reent/fstatr.c     | 5 +----
 newlib/libc/reent/isattyr.c    | 4 +---
 newlib/libc/stdlib/envlock.c   | 6 ++----
 newlib/libc/stdlib/eprintf.c   | 6 +-----
 newlib/libc/stdlib/getsubopt.c | 4 +---
 newlib/libc/stdlib/mlock.c     | 6 ++----
 newlib/libm/math/w_drem.c      | 3 +--
 8 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/newlib/libc/reent/closer.c b/newlib/libc/reent/closer.c
index 2d72b2ab5..eabe64f01 100644
--- a/newlib/libc/reent/closer.c
+++ b/newlib/libc/reent/closer.c
@@ -37,9 +37,7 @@ DESCRIPTION
 */
 
 int
-_close_r (ptr, fd)
-     struct _reent *ptr;
-     int fd;
+_close_r (struct _reent *ptr, int fd)
 {
   int ret;
 
diff --git a/newlib/libc/reent/fstatr.c b/newlib/libc/reent/fstatr.c
index 9a02e9a68..1521c3336 100644
--- a/newlib/libc/reent/fstatr.c
+++ b/newlib/libc/reent/fstatr.c
@@ -44,10 +44,7 @@ DESCRIPTION
 */
 
 int
-_fstat_r (ptr, fd, pstat)
-     struct _reent *ptr;
-     int fd;
-     struct stat *pstat;
+_fstat_r (struct _reent *ptr, int fd, struct stat *pstat)
 {
   int ret;
 
diff --git a/newlib/libc/reent/isattyr.c b/newlib/libc/reent/isattyr.c
index f76945519..bbc7f4c9b 100644
--- a/newlib/libc/reent/isattyr.c
+++ b/newlib/libc/reent/isattyr.c
@@ -42,9 +42,7 @@ DESCRIPTION
 */
 
 int
-_isatty_r (ptr, fd)
-     struct _reent *ptr;
-     int fd;
+_isatty_r (struct _reent *ptr, int fd)
 {
   int ret;
 
diff --git a/newlib/libc/stdlib/envlock.c b/newlib/libc/stdlib/envlock.c
index 3afe30ee9..bd843afc2 100644
--- a/newlib/libc/stdlib/envlock.c
+++ b/newlib/libc/stdlib/envlock.c
@@ -36,8 +36,7 @@ __LOCK_INIT_RECURSIVE(static, __env_recursive_mutex);
 #endif
 
 void
-__env_lock (ptr)
-     struct _reent *ptr;
+__env_lock (struct _reent *ptr)
 {
 #ifndef __SINGLE_THREAD__
   __lock_acquire_recursive (__env_recursive_mutex);
@@ -45,8 +44,7 @@ __env_lock (ptr)
 }
 
 void
-__env_unlock (ptr)
-     struct _reent *ptr;
+__env_unlock (struct _reent *ptr)
 {
 #ifndef __SINGLE_THREAD__
   __lock_release_recursive (__env_recursive_mutex);
diff --git a/newlib/libc/stdlib/eprintf.c b/newlib/libc/stdlib/eprintf.c
index 46cf8104b..9e4f5fd5a 100644
--- a/newlib/libc/stdlib/eprintf.c
+++ b/newlib/libc/stdlib/eprintf.c
@@ -14,11 +14,7 @@
 #include <stdio.h>
 
 void
-__eprintf (format, file, line, expression)
-     const char *format;
-     const char *file;
-     unsigned int line;
-     const char *expression;
+__eprintf (const char *format, const char *file, unsigned int line, const char *expression)
 {
   (void) fiprintf (stderr, format, file, line, expression);
   abort ();
diff --git a/newlib/libc/stdlib/getsubopt.c b/newlib/libc/stdlib/getsubopt.c
index 298624d35..4f3bb833f 100644
--- a/newlib/libc/stdlib/getsubopt.c
+++ b/newlib/libc/stdlib/getsubopt.c
@@ -45,9 +45,7 @@ static char sccsid[] = "@(#)getsubopt.c	8.1 (Berkeley) 6/4/93";
 char *suboptarg;
 
 int
-getsubopt(optionp, tokens, valuep)
-	char **optionp, **valuep;
-	char * const *tokens;
+getsubopt(char **optionp, char * const *tokens, char **valuep)
 {
 	int cnt;
 	char *p;
diff --git a/newlib/libc/stdlib/mlock.c b/newlib/libc/stdlib/mlock.c
index 23aa10173..e5ac13195 100644
--- a/newlib/libc/stdlib/mlock.c
+++ b/newlib/libc/stdlib/mlock.c
@@ -37,8 +37,7 @@ __LOCK_INIT_RECURSIVE(static, __malloc_recursive_mutex);
 #endif
 
 void
-__malloc_lock (ptr)
-     struct _reent *ptr;
+__malloc_lock (struct _reent *ptr)
 {
 #ifndef __SINGLE_THREAD__
   __lock_acquire_recursive (__malloc_recursive_mutex);
@@ -46,8 +45,7 @@ __malloc_lock (ptr)
 }
 
 void
-__malloc_unlock (ptr)
-     struct _reent *ptr;
+__malloc_unlock (struct _reent *ptr)
 {
 #ifndef __SINGLE_THREAD__
   __lock_release_recursive (__malloc_recursive_mutex);
diff --git a/newlib/libm/math/w_drem.c b/newlib/libm/math/w_drem.c
index d289bdaac..4472fa83f 100644
--- a/newlib/libm/math/w_drem.c
+++ b/newlib/libm/math/w_drem.c
@@ -8,8 +8,7 @@
 #include "fdlibm.h"
 
 double
-drem(x, y)
-	double x, y;
+drem(double x, double y)
 {
 	return remainder(x, y);
 }
-- 
2.51.0