From 40bf0efd47387010a4dafa8d07146643c8e00aaa Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 8 Oct 2005 09:05:08 +0000 Subject: [PATCH] (rpl_openat): Use the promoted type (int), not mode_t, as second argument to va_arg. Otherwise, some versions of gcc warn that `if this code is reached, the program will abort'. --- lib/openat.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/openat.c b/lib/openat.c index 929d264924..092e39610d 100644 --- a/lib/openat.c +++ b/lib/openat.c @@ -55,11 +55,8 @@ rpl_openat (int fd, char const *file, int flags, ...) { va_list arg; va_start (arg, flags); - - /* Assume that mode_t is passed compatibly with mode_t's type - after argument promotion. */ - mode = va_arg (arg, mode_t); - + /* Use the promoted type (int), not mode_t, as second argument. */ + mode = (mode_t) va_arg (arg, int); va_end (arg); } -- 2.47.3