diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-06-20 19:20:25 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-06-20 19:20:25 +0000 |
commit | 9d5fbcc019a802d14dcbd02c7c2a8659cc79ad55 (patch) | |
tree | 86df4d89980e78723c1a15aa5576ab71021a35fe | |
parent | 8280381dd703340cc2ad32e9c66e9de33f86444d (diff) | |
download | coreutils-9d5fbcc019a802d14dcbd02c7c2a8659cc79ad55.tar.xz |
(openat): Use ?:, not if, to work around GCC bug 4210.
-rw-r--r-- | lib/ChangeLog | 7 | ||||
-rw-r--r-- | lib/openat.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index ce97a3c6d..4cf0a6dc0 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2006-06-20 Paul Eggert <eggert@cs.ucla.edu> + + * openat.c (openat): Use ?:, not if, to work around GCC bug 4210 + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>. + Problem reported by Denis Excoffier in + <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>. + 2006-06-19 Jim Meyering <jim@meyering.net> Apply this change from gnulib: diff --git a/lib/openat.c b/lib/openat.c index 6a1b42ea6..7df52ea13 100644 --- a/lib/openat.c +++ b/lib/openat.c @@ -56,10 +56,9 @@ openat (int fd, char const *file, int flags, ...) /* If mode_t is narrower than int, use the promoted type (int), not mode_t. Use sizeof to guess whether mode_t is narrower; 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); } |