Revision | 373a21c2df7aaa1c668a014c86181bbbd0650777 (tree) |
---|---|
Zeit | 2021-12-24 08:29:56 |
Autor | Yann Sionneau <ysionneau@kalr...> |
Commiter | Waldemar Brodkorb |
Fix some warnings due to type issues
Fixes those two warnings:
In file included from <command-line>:
libc/sysdeps/linux/common/openat64.c:18:33: warning: 'openat64' alias between functions of incompatible types 'int(int, const char *, int, ...)' and 'int(int, const char *, int, mode_t)' {aka 'int(int, const char *, int, unsigned int)'} [-Wattribute-alias=]
./include/libc-symbols.h:177:31: note: in definition of macro '_strong_alias_untyped'
libc/sysdeps/linux/common/openat64.c:18:1: note: in expansion of macro 'strong_alias_untyped'
libc/sysdeps/linux/common/openat64.c:14:12: note: aliased declaration here
and
libc/sysdeps/linux/common/stat.c: In function 'stat':
libc/sysdeps/linux/common/stat.c:28:40: warning: passing argument 3 of 'fstatat64' from incompatible pointer type [-Wincompatible-pointer-types]
In file included from libc/sysdeps/linux/common/stat.c:11:
./include/sys/stat.h:258:35: note: expected 'struct stat64 * restrict' but argument is of type 'struct stat *'
Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
@@ -9,10 +9,18 @@ | ||
9 | 9 | #include <_lfs_64.h> |
10 | 10 | #include <sys/syscall.h> |
11 | 11 | #include <fcntl.h> |
12 | +#include <stdarg.h> | |
12 | 13 | |
13 | 14 | #ifdef __NR_openat |
14 | -static int __openat64(int fd, const char *file, int oflag, mode_t mode) | |
15 | +static int __openat64(int fd, const char *file, int oflag, ...) | |
15 | 16 | { |
17 | + va_list ap; | |
18 | + mode_t mode; | |
19 | + | |
20 | + va_start(ap, oflag); | |
21 | + mode = va_arg(ap, int); | |
22 | + va_end(ap); | |
23 | + | |
16 | 24 | return openat(fd, file, oflag | O_LARGEFILE, mode); |
17 | 25 | } |
18 | 26 | strong_alias_untyped(__openat64,openat64) |
@@ -25,7 +25,7 @@ int stat(const char *file_name, struct stat *buf) | ||
25 | 25 | |
26 | 26 | int stat(const char *file_name, struct stat *buf) |
27 | 27 | { |
28 | - return fstatat64(AT_FDCWD, file_name, buf, 0); | |
28 | + return fstatat64(AT_FDCWD, file_name, (struct stat64 *)buf, 0); | |
29 | 29 | } |
30 | 30 | #elif __NR_statx && defined __UCLIBC_HAVE_STATX__ |
31 | 31 | # include <fcntl.h> |