diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2021-12-27 16:29:38 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2021-12-27 16:57:20 +0100 |
commit | fa9e7b7dfa389758b6f32eab3b478110e870f7f1 (patch) | |
tree | d1450d139e765ba6ad463813af1890ffe15a2d32 | |
parent | 1643d07ebc9a776e90d4af62343c3339cfe2b324 (diff) | |
download | klibc-fa9e7b7dfa389758b6f32eab3b478110e870f7f1.tar.gz |
[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@decadent.org.uk>
-rw-r--r-- | usr/include/stdlib.h | 6 | ||||
-rw-r--r-- | usr/include/sys/time.h | 2 | ||||
-rw-r--r-- | 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 123eddc1bf7796..43bb8a364570d0 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 98497e707a91b5..da9f58099da194 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 db90cbbe0d7eab..6f71f7a6f10365 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 *); |