From 77f269d576ef80619fe96e4920df7515447abf89 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 20 Jun 2006 19:15:50 +0000 Subject: [PATCH] * openat.c (openat): Use ?:, not if, to work around GCC bug 4210 . Problem reported by Denis Excoffier in . --- lib/ChangeLog | 7 +++++++ lib/openat.c | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index e2ce00d054..3f5e4daf8f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2006-06-20 Paul Eggert + + * openat.c (openat): Use ?:, not if, to work around GCC bug 4210 + . + Problem reported by Denis Excoffier in + . + 2006-06-19 Simon Josefsson * inet_ntop.c: Always build inet_ntop4, since inet_ntop6 calls it. diff --git a/lib/openat.c b/lib/openat.c index 69d4c23f9a..572e6d5532 100644 --- a/lib/openat.c +++ b/lib/openat.c @@ -54,10 +54,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 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); } -- 2.30.2