[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] missing exit_status in tar-1.15.91

From: Paul Eggert
Subject: Re: [Bug-tar] missing exit_status in tar-1.15.91
Date: Tue, 20 Jun 2006 12:23:20 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Denis Excoffier <address@hidden> writes:

> openat.c: In function 'rpl_openat':
> openat.c:60: warning: 'mode_t' is promoted to 'int' when passed through '...'
> openat.c:60: warning: (so you should pass 'int' not 'mode_t' to 'va_arg')
> openat.c:60: note: if this code is reached, the program will abort

Thanks for reporting that.  That is a bogus warning from GCC.
I installed the following patch (in gnulib, and in coreutils).

2006-06-20  Paul Eggert  <address@hidden>

        * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
        Problem reported by Denis Excoffier in

--- openat.c    9 Jan 2006 23:13:56 -0000       1.8
+++ openat.c    20 Jun 2006 19:15:50 -0000      1.9
@@ -54,10 +54,9 @@ openat (int fd, char const *file, int fl
       /* If mode_t is narrower than int, use the promoted type (int),
          not mode_t.  Use sizeof to guess whether mode_t is nerrower;
          we don't know of any practical counterexamples.  */
-      if (sizeof (mode_t) < sizeof (int))
-       mode = va_arg (arg, int);
-      else
-       mode = va_arg (arg, mode_t);
+      mode = (sizeof (mode_t) < sizeof (int)
+             ? va_arg (arg, int)
+             : va_arg (arg, mode_t));
       va_end (arg);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]