From: Paul Eggert Date: Fri, 14 Nov 2025 20:19:30 +0000 (-0800) Subject: Work around Oracle Developer Studio compiler bug X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdb586803b762d9021db2ae8bf5dad3f9b8e4f77;p=thirdparty%2Ftar.git Work around Oracle Developer Studio compiler bug * src/create.c (dump_file0): Reword. --- diff --git a/src/create.c b/src/create.c index aa5acb63..5cecdcea 100644 --- a/src/create.c +++ b/src/create.c @@ -1632,8 +1632,17 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p) if (!transform_name (&st->file_name, XFORM_REGFILE)) return NULL; - struct fdbase f = (top_level ? fdbase (name) - : (struct fdbase) { .fd = parent->fd, .base = name }); + struct fdbase f; + if (top_level) + f = fdbase (name); + else + { + /* Avoid a compound literal here, to work around a bug + in Oracle Developer Studio 12.6 (sparc64). */ + f.fd = parent->fd; + f.base = name; + } + if (!top_level && parent->fd < 0) { errno = - parent->fd; @@ -1732,8 +1741,15 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p) ok = dump_dir (st); fd = st->fd; - f = (top_level ? fdbase (name) - : (struct fdbase) { .fd = parent->fd, .base = name }); + if (top_level) + f = fdbase (name); + else + { + /* Avoid a compound literal here, to work around a bug + in Oracle Developer Studio 12.6 (sparc64). */ + f.fd = parent->fd; + f.base = name; + } } else {