From: Jim Meyering Date: Sat, 8 Oct 2005 09:05:08 +0000 (+0000) Subject: (rpl_openat): Use the promoted type (int), not mode_t, X-Git-Tag: v5.91~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40bf0efd47387010a4dafa8d07146643c8e00aaa;p=thirdparty%2Fcoreutils.git (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'. --- 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); }