[COMMIT osv master] Avoid implicit int

0 views
Skip to first unread message

Commit Bot

unread,
Jun 28, 2024, 10:53:45 AM (5 days ago) Jun 28
to osv...@googlegroups.com, Nadav Har'El
From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

Avoid implicit int

When I learned C, some 40 years ago, it was common to drop the keyword
"int" in various places in function declaration, assuming "int" was the
default. This practice faded over the years, but gcc still accept some
cases of "implicit int" for many years, until gcc 14.1.1 started to
crack down on them.

This patch fixes one case of implied "int" that gcc no longer accepts.

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/include/api/string.h b/include/api/string.h
--- a/include/api/string.h
+++ b/include/api/string.h
@@ -59,7 +59,7 @@ char *strerror (int);
char *strtok_r (char *__restrict, const char *__restrict, char **__restrict);
#ifndef _GNU_SOURCE
int __xpg_strerror_r (int, char *, size_t);
-static inline strerror_r(int __errnum, char* __buf, size_t __bufsize)
+static inline int strerror_r(int __errnum, char* __buf, size_t __bufsize)
{
return __xpg_strerror_r(__errnum, __buf, __bufsize);
}
Reply all
Reply to author
Forward
0 new messages