klibc-bot for Ben Hutchings
2021-Dec-27 17:18 UTC
[klibc] [klibc:master] Use bounded array parameter types consistently
Commit-ID: fa9e7b7dfa389758b6f32eab3b478110e870f7f1 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=fa9e7b7dfa389758b6f32eab3b478110e870f7f1 Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Mon, 27 Dec 2021 16:29:38 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Mon, 27 Dec 2021 16:57:20 +0100 [klibc] Use bounded array parameter types consistently A function parameter declared with array type really has pointer type, and multiple declarations of a function are allowed to specify the same parameter as T[n], T[] or T *. However, gcc 11 now warns if they don't exactly match. Change the prototypes of {j,n}rand48(), seed48(), pipe{,2}(), and utimes() to declare parameters with the same bounded array types that their definitions use. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/include/stdlib.h | 6 +++--- usr/include/sys/time.h | 2 +- usr/include/unistd.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/usr/include/stdlib.h b/usr/include/stdlib.h index 123eddc1..43bb8a36 100644 --- a/usr/include/stdlib.h +++ b/usr/include/stdlib.h @@ -55,11 +55,11 @@ __extern void *bsearch(const void *, const void *, size_t, size_t, __comparefunc_t); __extern void qsort(void *, size_t, size_t, __comparefunc_t); -__extern long jrand48(unsigned short *); +__extern long jrand48(unsigned short[3]); __extern long mrand48(void); -__extern long nrand48(unsigned short *); +__extern long nrand48(unsigned short[3]); __extern long lrand48(void); -__extern unsigned short *seed48(const unsigned short *); +__extern unsigned short *seed48(const unsigned short[3]); __extern void srand48(long); #define RAND_MAX 0x7fffffff diff --git a/usr/include/sys/time.h b/usr/include/sys/time.h index 98497e70..da9f5809 100644 --- a/usr/include/sys/time.h +++ b/usr/include/sys/time.h @@ -52,6 +52,6 @@ __extern int gettimeofday(struct timeval *, struct timezone *); __extern int settimeofday(const struct timeval *, const struct timezone *); __extern int getitimer(int, struct itimerval *); __extern int setitimer(int, const struct itimerval *, struct itimerval *); -__extern int utimes(const char *, const struct timeval *); +__extern int utimes(const char *, const struct timeval[2]); #endif /* _SYS_TIME_H */ diff --git a/usr/include/unistd.h b/usr/include/unistd.h index db90cbbe..6f71f7a6 100644 --- a/usr/include/unistd.h +++ b/usr/include/unistd.h @@ -71,8 +71,8 @@ __extern int fchmod(int, mode_t); __extern int mkdir(const char *, mode_t); __extern int mkdirat(int, const char *, mode_t); __extern int rmdir(const char *); -__extern int pipe(int *); -__extern int pipe2(int *, int); +__extern int pipe(int[2]); +__extern int pipe2(int[2], int); __extern int chroot(const char *); __extern int symlink(const char *, const char *); __extern int symlinkat(const char *, int, const char *);