mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
tests: Fix build with clang
clang doesn't like mode_t type as an argument to va_arg(): error: second argument to 'va_arg' is of promotable type 'mode_t' (aka 'unsigned short'); this va_arg has undefined behavior because arguments will be promoted to 'int' mode = va_arg(ap, mode_t); ^~~~~~ Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
000e950455
commit
2925f9395e
@ -267,7 +267,7 @@ int open(const char *path, int flags, ...)
|
||||
*/
|
||||
if (flags & O_CREAT) {
|
||||
va_start(ap, flags);
|
||||
mode = va_arg(ap, mode_t);
|
||||
mode = (mode_t) va_arg(ap, int);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ int open(const char *pathname, int flags, ...)
|
||||
*/
|
||||
if (flags & O_CREAT) {
|
||||
va_start(ap, flags);
|
||||
mode = va_arg(ap, mode_t);
|
||||
mode = (mode_t) va_arg(ap, int);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user