From unknown Sun Jun 22 07:47:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9380: Compilation problems with coreutils-8.9 Resent-From: Rob McMahon Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 26 Aug 2011 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9380 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 9380@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13143751106466 (code B ref -1); Fri, 26 Aug 2011 16:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Aug 2011 16:11:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qwz0V-0001gB-In for submit@debbugs.gnu.org; Fri, 26 Aug 2011 12:11:49 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwxuO-0005rQ-91 for submit@debbugs.gnu.org; Fri, 26 Aug 2011 11:01:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwxrh-0002Nr-20 for submit@debbugs.gnu.org; Fri, 26 Aug 2011 10:58:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:40533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwxrh-0002Nn-0I for submit@debbugs.gnu.org; Fri, 26 Aug 2011 10:58:37 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwxre-0001FQ-RG for bug-coreutils@gnu.org; Fri, 26 Aug 2011 10:58:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwxrc-0002NX-8m for bug-coreutils@gnu.org; Fri, 26 Aug 2011 10:58:34 -0400 Received: from mail-relay-1.csv.warwick.ac.uk ([137.205.128.7]:33203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwxrb-0002NB-UJ for bug-coreutils@gnu.org; Fri, 26 Aug 2011 10:58:32 -0400 Received: from localhost (localhost [127.0.0.1]) by mail-relay-1.csv.warwick.ac.uk (8.13.8/8.13.6) with ESMTP id p7QEwS2Y051338 for ; Fri, 26 Aug 2011 15:58:28 +0100 (BST) X-Virus-Scanned: amavisd-new at warwick.ac.uk Received: from mail-relay-1.csv.warwick.ac.uk ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WPIUN7iKwEAE for ; Fri, 26 Aug 2011 15:58:26 +0100 (BST) Received: from [137.205.191.9] (wonky [137.205.191.9]) by mail-relay-1.csv.warwick.ac.uk (8.13.8/8.13.6) with ESMTP id p7QEwPE7051287 for ; Fri, 26 Aug 2011 15:58:26 +0100 (BST) X-Envelope-From: Rob.McMahon@warwick.ac.uk Message-ID: <4E57B491.9000402@warwick.ac.uk> Date: Fri, 26 Aug 2011 15:58:25 +0100 From: Rob McMahon User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:6.0) Gecko/20110814 Thunderbird/6.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050204080102000802040308" X-DCC-Warwick-Metrics: bluebell 1333; Body=1 Fuz1=1 Fuz2=1 X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Fri, 26 Aug 2011 12:11:46 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) This is a multi-part message in MIME format. --------------050204080102000802040308 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I suspect you're going to say "upgrade to a more modern compiler" for most of these patches, but I had cause to install a later coreutils on an old box where this is not a viable option, running cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18 There are many uses of later C compilers to accept declarations intermingled with statements, which are not supported by this compiler. The attached diffs fix all these problems. Many of them are just swapping a couple of lines, which is probably worth it in the interests of compatibility. Rob -- E-Mail: Rob.McMahon@warwick.ac.uk PHONE: +44 24 7652 3037 Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England --------------050204080102000802040308 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="diffs" diff -ru1 dist/coreutils-8.9/lib/heap.c coreutils-8.9/lib/heap.c --- dist/coreutils-8.9/lib/heap.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/lib/heap.c 2011-08-25 10:19:13.940953000 +0100 @@ -95,2 +95,4 @@ { + void *top; + if (heap->count == 0) @@ -98,3 +100,3 @@ - void *top = heap->array[1]; + top = heap->array[1]; heap->array[1] = heap->array[heap->count--]; diff -ru1 dist/coreutils-8.9/src/chroot.c coreutils-8.9/src/chroot.c --- dist/coreutils-8.9/src/chroot.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/chroot.c 2011-08-25 10:24:47.462712000 +0100 @@ -153,2 +153,3 @@ char const *groups = NULL; + bool fail; @@ -213,3 +214,3 @@ - bool fail = false; + fail = false; diff -ru1 dist/coreutils-8.9/src/copy.c coreutils-8.9/src/copy.c --- dist/coreutils-8.9/src/copy.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/copy.c 2011-08-25 10:26:23.581904000 +0100 @@ -2278,2 +2278,3 @@ { + bool first_dir_created_per_command_line_arg; assert (valid_options (options)); @@ -2290,3 +2291,3 @@ - bool first_dir_created_per_command_line_arg = false; + first_dir_created_per_command_line_arg = false; return copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL, diff -ru1 dist/coreutils-8.9/src/csplit.c coreutils-8.9/src/csplit.c --- dist/coreutils-8.9/src/csplit.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/csplit.c 2011-08-25 11:21:12.885525000 +0100 @@ -1202,4 +1202,5 @@ int flags = 0; + size_t count; - for (size_t count = 0; ; count++) + for (count = 0; ; count++) { @@ -1277,6 +1278,9 @@ bool percent = false; + char *f; + int maxlen; - for (char *f = format; *f; f++) + for (f = format; *f; f++) if (*f == '%' && *++f != '%') { + int flags; if (percent) @@ -1285,3 +1289,2 @@ percent = true; - int flags; f += get_format_flags (f, &flags); @@ -1299,3 +1302,3 @@ - int maxlen = snprintf (NULL, 0, format, UINT_MAX); + maxlen = snprintf (NULL, 0, format, UINT_MAX); if (! (0 <= maxlen && maxlen <= SIZE_MAX)) @@ -1374,2 +1377,3 @@ + { size_t prefix_len = strlen (prefix); @@ -1382,2 +1386,3 @@ filename_space = xmalloc (prefix_len + max_digit_string_len + 1); + } diff -ru1 dist/coreutils-8.9/src/dd.c coreutils-8.9/src/dd.c --- dist/coreutils-8.9/src/dd.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/dd.c 2011-08-25 10:59:44.159093000 +0100 @@ -842,2 +842,4 @@ int old_flags = fcntl (STDOUT_FILENO, F_GETFL); + off_t off; + if (fcntl (STDOUT_FILENO, F_SETFL, old_flags & ~O_DIRECT) != 0) @@ -851,3 +853,3 @@ posix_fadvise failure. */ - off_t off = lseek (STDOUT_FILENO, 0, SEEK_CUR); + off = lseek (STDOUT_FILENO, 0, SEEK_CUR); if (0 <= off) diff -ru1 dist/coreutils-8.9/src/du.c coreutils-8.9/src/du.c --- dist/coreutils-8.9/src/du.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/du.c 2011-08-25 11:44:24.472799000 +0100 @@ -432,4 +432,5 @@ { + FTSENT const *e; fts_set (fts, ent, FTS_AGAIN); - FTSENT const *e = fts_read (fts); + e = fts_read (fts); assert (e == ent); @@ -455,4 +456,5 @@ { + FTSENT const *e; fts_set (fts, ent, FTS_SKIP); - FTSENT const *e = fts_read (fts); + e = fts_read (fts); assert (e == ent); @@ -623,2 +625,5 @@ + static char *temp_argv[] = { NULL, NULL }; + struct argv_iterator *ai; + cwd_only[0] = bad_cast ("."); @@ -866,3 +871,2 @@ - struct argv_iterator *ai; if (files_from) @@ -914,3 +918,2 @@ bit_flags |= symlink_deref_bits; - static char *temp_argv[] = { NULL, NULL }; diff -ru1 dist/coreutils-8.9/src/expr.c coreutils-8.9/src/expr.c --- dist/coreutils-8.9/src/expr.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/expr.c 2011-08-25 11:23:09.719524000 +0100 @@ -118,4 +118,4 @@ { - (void) str; (void) base; char buf[INT_BUFSIZE_BOUND (intmax_t)]; + (void) str; (void) base; return xstrdup (imaxtostr (z[0], buf)); @@ -140,4 +140,4 @@ { - (void) base; char buf[INT_BUFSIZE_BOUND (intmax_t)]; + (void) base; return fputs (imaxtostr (z[0], buf), stream) != EOF; diff -ru1 dist/coreutils-8.9/src/getlimits.c coreutils-8.9/src/getlimits.c --- dist/coreutils-8.9/src/getlimits.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/getlimits.c 2011-08-25 11:32:51.328096000 +0100 @@ -90,2 +90,4 @@ char *p = absnum + strlen (absnum); + char *result; + absnum[-1] = '0'; @@ -94,3 +96,3 @@ ++*p; - char *result = MIN (absnum, p); + result = MIN (absnum, p); if (negative) diff -ru1 dist/coreutils-8.9/src/join.c coreutils-8.9/src/join.c --- dist/coreutils-8.9/src/join.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/join.c 2011-08-25 11:04:36.004207000 +0100 @@ -713,2 +713,3 @@ + { /* If the user did not specify --check-order, then we read the @@ -754,2 +755,3 @@ free (line); + } diff -ru1 dist/coreutils-8.9/src/ls.c coreutils-8.9/src/ls.c --- dist/coreutils-8.9/src/ls.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/ls.c 2011-08-25 11:47:04.872791000 +0100 @@ -1034,9 +1034,10 @@ #ifdef HAVE_NL_LANGINFO - required_mon_width = MAX_MON_WIDTH; size_t curr_max_width; + required_mon_width = MAX_MON_WIDTH; do { + int i; curr_max_width = required_mon_width; required_mon_width = 0; - for (int i = 0; i < 12; i++) + for (i = 0; i < 12; i++) { @@ -3464,2 +3465,4 @@ const char *pb; + size_t ret; + if (required_mon_width && (pb = strstr (fmt, "%b"))) @@ -3476,3 +3479,3 @@ } - size_t ret = nstrftime (buf, size, nfmt, tm, __utc, __ns); + ret = nstrftime (buf, size, nfmt, tm, __utc, __ns); return ret; @@ -3623,3 +3626,3 @@ ]; - size_t s; + size_t s, w; char *p; @@ -3813,3 +3816,3 @@ DIRED_FPUTS (buf, stdout, p - buf); - size_t w = print_name_with_quoting (f, false, &dired_obstack, p - buf); + w = print_name_with_quoting (f, false, &dired_obstack, p - buf); @@ -4001,2 +4004,3 @@ { + size_t width; const char* name = symlink_target ? f->linkname : f->name; @@ -4011,3 +4015,3 @@ - size_t width = quote_name (stdout, name, filename_quoting_options, NULL); + width = quote_name (stdout, name, filename_quoting_options, NULL); dired_pos += width; @@ -4049,2 +4053,3 @@ char buf[MAX (LONGEST_HUMAN_READABLE + 1, INT_BUFSIZE_BOUND (uintmax_t))]; + size_t width; @@ -4065,3 +4070,3 @@ - size_t width = print_name_with_quoting (f, false, NULL, start_col); + width = print_name_with_quoting (f, false, NULL, start_col); diff -ru1 dist/coreutils-8.9/src/nproc.c coreutils-8.9/src/nproc.c --- dist/coreutils-8.9/src/nproc.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/nproc.c 2011-08-25 11:06:38.550677000 +0100 @@ -78,2 +78,4 @@ unsigned long nproc, ignore = 0; + enum nproc_query mode; + initialize_main (&argc, &argv); @@ -86,3 +88,3 @@ - enum nproc_query mode = NPROC_CURRENT_OVERRIDABLE; + mode = NPROC_CURRENT_OVERRIDABLE; diff -ru1 dist/coreutils-8.9/src/od.c coreutils-8.9/src/od.c --- dist/coreutils-8.9/src/od.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/od.c 2011-08-25 11:24:52.628883000 +0100 @@ -594,2 +594,4 @@ int field_width; + struct lconv const *locale; + size_t decimal_point_len; @@ -773,4 +775,4 @@ - struct lconv const *locale = localeconv (); - size_t decimal_point_len = + locale = localeconv (); + decimal_point_len = (locale->decimal_point[0] ? strlen (locale->decimal_point) : 1); diff -ru1 dist/coreutils-8.9/src/remove.c coreutils-8.9/src/remove.c --- dist/coreutils-8.9/src/remove.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/remove.c 2011-08-25 12:00:00.112933000 +0100 @@ -173,2 +173,4 @@ native or /proc/self/fd allows us to skip a chdir. */ + size_t file_name_len; + if (!openat_needs_fchdir ()) @@ -182,3 +184,3 @@ /* This implements #5: */ - size_t file_name_len = strlen (full_name); + file_name_len = strlen (full_name); @@ -221,11 +223,12 @@ char const *filename = ent->fts_accpath; - if (is_empty_p) - *is_empty_p = T_UNKNOWN; - struct stat st; struct stat *sbuf = &st; - cache_stat_init (sbuf); - int dirent_type = is_dir ? DT_DIR : DT_UNKNOWN; int write_protected = 0; + int wp_errno = 0; + + if (is_empty_p) + *is_empty_p = T_UNKNOWN; + + cache_stat_init (sbuf); @@ -240,3 +243,2 @@ - int wp_errno = 0; if (!x->ignore_missing_files @@ -252,2 +254,5 @@ { + char const *quoted_name; + bool is_empty; + if (0 <= write_protected && dirent_type == DT_UNKNOWN) @@ -288,3 +293,3 @@ - char const *quoted_name = quote (full_name); + quoted_name = quote (full_name); @@ -296,3 +301,2 @@ - bool is_empty; if (is_empty_p) @@ -545,2 +549,4 @@ { + bool is_dir; + enum RM_status s; /* With --one-file-system, do not attempt to remove a mount point. @@ -559,4 +565,4 @@ - bool is_dir = ent->fts_info == FTS_DP || ent->fts_info == FTS_DNR; - enum RM_status s = prompt (fts, ent, is_dir, x, PA_REMOVE_DIR, NULL); + is_dir = ent->fts_info == FTS_DP || ent->fts_info == FTS_DNR; + s = prompt (fts, ent, is_dir, x, PA_REMOVE_DIR, NULL); if (s != RM_OK) @@ -601,2 +607,4 @@ | FTS_PHYSICAL); + FTS *fts; + enum RM_status s; @@ -605,3 +613,3 @@ - FTS *fts = xfts_open (file, bit_flags, NULL); + fts = xfts_open (file, bit_flags, NULL); @@ -622,3 +630,3 @@ - enum RM_status s = rm_fts (fts, ent, x); + s = rm_fts (fts, ent, x); diff -ru1 dist/coreutils-8.9/src/rm.c coreutils-8.9/src/rm.c --- dist/coreutils-8.9/src/rm.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/rm.c 2011-08-25 11:09:19.854004000 +0100 @@ -328,4 +328,6 @@ + { size_t n_files = argc - optind; char **file = argv + optind; + enum RM_status status; @@ -342,5 +344,6 @@ - enum RM_status status = rm (file, &x); + status = rm (file, &x); assert (VALID_STATUS (status)); exit (status == RM_ERROR ? EXIT_FAILURE : EXIT_SUCCESS); + } } diff -ru1 dist/coreutils-8.9/src/seq.c coreutils-8.9/src/seq.c --- dist/coreutils-8.9/src/seq.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/seq.c 2011-08-25 11:25:38.840888000 +0100 @@ -149,2 +149,3 @@ { + char const *e; char const *decimal_point = strchr (arg, '.'); @@ -162,3 +163,3 @@ } - char const *e = strchr (arg, 'e'); + e = strchr (arg, 'e'); if (! e) @@ -316,2 +317,4 @@ size_t last_width = last.width + (prec - last.precision); + size_t width; + if (last.precision && prec == 0) @@ -320,3 +323,3 @@ last_width++; /* include space for '.' */ - size_t width = MAX (first_width, last_width); + width = MAX (first_width, last_width); if (width <= INT_MAX) diff -ru1 dist/coreutils-8.9/src/shred.c coreutils-8.9/src/shred.c --- dist/coreutils-8.9/src/shred.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/shred.c 2011-08-25 11:29:19.408081000 +0100 @@ -470,3 +470,3 @@ SECTOR_SIZE, except at the end. */ - verify (sizeof r % SECTOR_SIZE == 0); + verify_true (sizeof r % SECTOR_SIZE == 0); if (errnum == EIO && 0 <= size && (soff | SECTOR_MASK) < lim) diff -ru1 dist/coreutils-8.9/src/sort.c coreutils-8.9/src/sort.c --- dist/coreutils-8.9/src/sort.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/sort.c 2011-08-25 12:11:46.492528000 +0100 @@ -730,5 +730,6 @@ struct tempnode test; + struct tempnode *node; test.pid = pid; - struct tempnode *node = hash_delete (proctab, &test); + node = hash_delete (proctab, &test); if (! node) @@ -1116,2 +1117,3 @@ FILE *fp = NULL; + pid_t child; @@ -1124,3 +1126,3 @@ - pid_t child = pipe_fork (pipefds, MAX_FORK_TRIES_DECOMPRESS); + child = pipe_fork (pipefds, MAX_FORK_TRIES_DECOMPRESS); @@ -1880,2 +1882,4 @@ { + int diff; + while (blanks[to_uchar (*a)]) @@ -1885,3 +1889,3 @@ - int diff = find_unit_order (a) - find_unit_order (b); + diff = find_unit_order (a) - find_unit_order (b); return (diff ? diff : strnumcmp (a, b, decimal_point, thousands_sep)); @@ -1999,4 +2003,6 @@ { + size_t translated_size; + errno = 0; - size_t translated_size = strxfrm (dest, src, destsize); + translated_size = strxfrm (dest, src, destsize); @@ -2027,3 +2033,3 @@ int xfrm_diff = 0; - + int diff; char stackbuf[4000]; @@ -2059,2 +2065,5 @@ size_t guess_bufsize = 3 * (lena + lenb) + 2; + size_t sizea, sizeb; + bool a_fits; + if (bufsize < guess_bufsize) @@ -2071,6 +2080,6 @@ - size_t sizea = + sizea = (texta < lima ? xstrxfrm (buf, texta, bufsize) + 1 : 0); - bool a_fits = sizea <= bufsize; - size_t sizeb = + a_fits = sizea <= bufsize; + sizeb = (textb < limb @@ -2127,3 +2136,3 @@ md5_process_bytes (textb, lenb, &s[1]); md5_finish_ctx (&s[1], dig[1]); - int diff = memcmp (dig[0], dig[1], sizeof dig[0]); + diff = memcmp (dig[0], dig[1], sizeof dig[0]); @@ -2198,2 +2207,3 @@ char *lim = text + line->length - 1; + size_t offset, width; @@ -2208,2 +2218,3 @@ { + char *tighter_lim; char saved = *lim; @@ -2214,3 +2225,3 @@ - char *tighter_lim = beg; + tighter_lim = beg; @@ -2248,4 +2259,4 @@ - size_t offset = debug_width (text, beg); - size_t width = debug_width (beg, lim); + offset = debug_width (text, beg); + width = debug_width (beg, lim); mark_key (offset, width); @@ -2323,2 +2334,6 @@ { + bool implicit_skip; + bool maybe_space_aligned; + bool line_offset; + if (key->obsolete_used) @@ -2357,6 +2372,6 @@ /* Warn about significant leading blanks. */ - bool implicit_skip = key_numeric (key) || key->month; - bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) + implicit_skip = key_numeric (key) || key->month; + maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) && !(key->schar || key->echar); - bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ + line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ if (!gkey_only && tab == TAB_DEFAULT && !line_offset @@ -2404,6 +2419,7 @@ bool ugkey_reverse = ugkey.reverse; - if (!(stable || unique)) - ugkey.reverse = false; /* The following is too big, but guaranteed to be "big enough". */ char opts[sizeof short_options]; + + if (!(stable || unique)) + ugkey.reverse = false; key_to_opts (&ugkey, opts); @@ -2440,2 +2456,3 @@ bool const *ignore = key->ignore; + size_t lena, lenb; @@ -2446,4 +2463,4 @@ /* Find the lengths. */ - size_t lena = lima - texta; - size_t lenb = limb - textb; + lena = lima - texta; + lenb = limb - textb; @@ -3116,2 +3133,4 @@ struct line *hi = lines - nlo; + struct line *dest; + struct line const *sorted_lo; @@ -3123,4 +3142,2 @@ - struct line *dest; - struct line const *sorted_lo; if (to_temp) @@ -3477,3 +3494,3 @@ /* Number of lines in LINES and DEST. */ - size_t const total_lines; + size_t total_lines; @@ -3722,2 +3739,4 @@ size_t nopened = open_input_files (files, nfiles, &fps); + FILE *tfp; + struct tempnode *temp; @@ -3742,4 +3761,2 @@ we closed and tried to create). */ - FILE *tfp; - struct tempnode *temp; do @@ -3838,6 +3855,8 @@ struct merge_node_queue queue; + struct merge_node *merge_tree; + struct merge_node *root; + queue_init (&queue, nthreads); - struct merge_node *merge_tree = - merge_tree_init (nthreads, buf.nlines, line); - struct merge_node *root = merge_tree + 1; + merge_tree = merge_tree_init (nthreads, buf.nlines, line); + root = merge_tree + 1; @@ -4608,2 +4627,4 @@ { + size_t nthreads_max; + if (!nthreads) @@ -4615,3 +4636,3 @@ /* Avoid integer overflow later. */ - size_t nthreads_max = SIZE_MAX / (2 * sizeof (struct merge_node)); + nthreads_max = SIZE_MAX / (2 * sizeof (struct merge_node)); nthreads = MIN (nthreads, nthreads_max); diff -ru1 dist/coreutils-8.9/src/split.c coreutils-8.9/src/split.c --- dist/coreutils-8.9/src/split.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/split.c 2011-08-25 11:30:28.566248000 +0100 @@ -454,7 +454,5 @@ { - assert (n && k <= n && n <= file_size); - - const off_t chunk_size = file_size / n; + off_t chunk_size; uintmax_t chunk_no = 1; - off_t chunk_end = chunk_size - 1; + off_t chunk_end; off_t n_written = 0; @@ -462,2 +460,7 @@ + assert (n && k <= n && n <= file_size); + + chunk_size = file_size / n; + chunk_end = chunk_size - 1; + if (k > 1) diff -ru1 dist/coreutils-8.9/src/stat.c coreutils-8.9/src/stat.c --- dist/coreutils-8.9/src/stat.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/stat.c 2011-08-25 12:02:51.677107000 +0100 @@ -544,2 +544,6 @@ int precision = 0; + int divisor; + int frac_sec; + int int_len; + int i; bool frac_left_adjust = false; @@ -566,2 +570,3 @@ later. */ + long int lwidth; char *p = dot; @@ -573,3 +578,3 @@ - long int lwidth = strtol (p, NULL, 10); + lwidth = strtol (p, NULL, 10); width = (lwidth <= INT_MAX ? lwidth : INT_MAX); @@ -577,5 +582,7 @@ { + int w_d; + p += (*p == '0'); sec_prefix_len = p - pformat; - int w_d = (decimal_point_len < width + w_d = (decimal_point_len < width ? width - decimal_point_len @@ -588,3 +595,4 @@ char *dst = pformat; - for (char const *src = dst; src < p; src++) + char const *src; + for (src = dst; src < p; src++) { @@ -604,7 +612,7 @@ - int divisor = 1; - for (int i = precision; i < 9; i++) + divisor = 1; + for (i = precision; i < 9; i++) divisor *= 10; - int frac_sec = arg.tv_nsec / divisor; - int int_len; + frac_sec = arg.tv_nsec / divisor; + int_len; @@ -759,2 +767,3 @@ char const * bind_mount = NULL; + struct mount_entry *me; @@ -769,3 +778,2 @@ - struct mount_entry *me; for (me = mount_list; me; me = me->me_next) @@ -844,6 +852,7 @@ { + struct timespec z = {0, 0}; if (0 <= ts.tv_nsec) return ts; - struct timespec z = {0, 0}; - return z; + else + return z; } @@ -1055,2 +1064,3 @@ { + unsigned int fmt_code; size_t len = strspn (b + 1, printf_flags); @@ -1061,3 +1071,3 @@ len = fmt_char - (b + 1); - unsigned int fmt_code = *fmt_char; + fmt_code = *fmt_char; memcpy (dest, b, len + 1); @@ -1149,2 +1159,3 @@ STRUCT_STATVFS statfsbuf; + bool fail; @@ -1164,3 +1175,3 @@ - bool fail = print_it (format, filename, print_statfs, &statfsbuf); + fail = print_it (format, filename, print_statfs, &statfsbuf); return ! fail; @@ -1174,2 +1185,3 @@ struct stat statbuf; + bool fail; @@ -1197,3 +1209,3 @@ - bool fail = print_it (format, filename, print_stat, &statbuf); + fail = print_it (format, filename, print_stat, &statbuf); return ! fail; @@ -1400,2 +1412,3 @@ bool ok = true; + struct lconv const *locale; @@ -1407,3 +1420,3 @@ - struct lconv const *locale = localeconv (); + locale = localeconv (); decimal_point = (locale->decimal_point[0] ? locale->decimal_point : "."); diff -ru1 dist/coreutils-8.9/src/system.h coreutils-8.9/src/system.h --- dist/coreutils-8.9/src/system.h 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/system.h 2011-08-25 10:23:36.641538000 +0100 @@ -595,2 +595,4 @@ { + const char *lc_messages; + printf (_("\nReport %s bugs to %s\n"), last_component (program_name), @@ -604,3 +606,3 @@ Note we still output for 'C' so that it gets included in the man page. */ - const char *lc_messages = setlocale (LC_MESSAGES, NULL); + lc_messages = setlocale (LC_MESSAGES, NULL); if (lc_messages && strncmp (lc_messages, "en_", 3)) diff -ru1 dist/coreutils-8.9/src/wc.c coreutils-8.9/src/wc.c --- dist/coreutils-8.9/src/wc.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/wc.c 2011-08-25 11:42:53.969485000 +0100 @@ -592,4 +592,6 @@ bool ok; + bool read_tokens; int optc; int nfiles; + int i; char **files; @@ -598,2 +600,3 @@ struct Tokens tok; + struct argv_iterator *ai; @@ -654,4 +657,3 @@ - bool read_tokens = false; - struct argv_iterator *ai; + read_tokens = false; if (files_from) @@ -659,2 +661,3 @@ FILE *stream; + struct stat st; @@ -682,3 +685,2 @@ size is reasonable. Otherwise, we'll read a name at a time. */ - struct stat st; if (fstat (fileno (stream), &st) == 0 @@ -714,3 +716,2 @@ - int i; ok = true; --------------050204080102000802040308-- From unknown Sun Jun 22 07:47:40 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Rob McMahon Subject: bug#9380: closed (Re: bug#9380: Compilation problems with coreutils-8.9) Message-ID: References: <4E57C709.8040806@redhat.com> <4E57B491.9000402@warwick.ac.uk> X-Gnu-PR-Message: they-closed 9380 X-Gnu-PR-Package: coreutils Reply-To: 9380@debbugs.gnu.org Date: Fri, 26 Aug 2011 16:21:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1314375663-9944-1" This is a multi-part message in MIME format... ------------=_1314375663-9944-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #9380: Compilation problems with coreutils-8.9 which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 9380@debbugs.gnu.org. --=20 9380: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D9380 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1314375663-9944-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 9380-done) by debbugs.gnu.org; 26 Aug 2011 16:20:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qwz8U-0002Yg-Q6 for submit@debbugs.gnu.org; Fri, 26 Aug 2011 12:20:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qwz8S-0002YE-KF for 9380-done@debbugs.gnu.org; Fri, 26 Aug 2011 12:20:01 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7QGHEg1031777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Aug 2011 12:17:14 -0400 Received: from [10.3.113.46] (ovpn-113-46.phx2.redhat.com [10.3.113.46]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7QGHEk0003696; Fri, 26 Aug 2011 12:17:14 -0400 Message-ID: <4E57C709.8040806@redhat.com> Date: Fri, 26 Aug 2011 10:17:13 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.12 MIME-Version: 1.0 To: Rob McMahon Subject: Re: bug#9380: Compilation problems with coreutils-8.9 References: <4E57B491.9000402@warwick.ac.uk> In-Reply-To: <4E57B491.9000402@warwick.ac.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 9380-done Cc: 9380-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) tag 9380 notabug thanks On 08/26/2011 08:58 AM, Rob McMahon wrote: > I suspect you're going to say "upgrade to a more modern compiler" for > most of these patches, but I had cause to install a later coreutils on > an old box where this is not a viable option, Thanks for the efforts; and hopefully by posting to the list, you have made life for someone else in the same situation. However, you are correct that we will not take these patches into the upstream repository. According to README, coreutils intentionally requires minimal C99 features from your compiler, one of which is supporting declaration-after-statement, and we are unwilling to take on the maintenance burden of uglifying the code just to support super-old C89 compilers. You may also want to try building the latest release (coreutils is currently at 8.12), although you will have to make the same manual C89 patches on your own, as it will not be supported upstream. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org ------------=_1314375663-9944-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Aug 2011 16:11:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qwz0V-0001gB-In for submit@debbugs.gnu.org; Fri, 26 Aug 2011 12:11:49 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwxuO-0005rQ-91 for submit@debbugs.gnu.org; Fri, 26 Aug 2011 11:01:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwxrh-0002Nr-20 for submit@debbugs.gnu.org; Fri, 26 Aug 2011 10:58:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:40533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwxrh-0002Nn-0I for submit@debbugs.gnu.org; Fri, 26 Aug 2011 10:58:37 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwxre-0001FQ-RG for bug-coreutils@gnu.org; Fri, 26 Aug 2011 10:58:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwxrc-0002NX-8m for bug-coreutils@gnu.org; Fri, 26 Aug 2011 10:58:34 -0400 Received: from mail-relay-1.csv.warwick.ac.uk ([137.205.128.7]:33203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwxrb-0002NB-UJ for bug-coreutils@gnu.org; Fri, 26 Aug 2011 10:58:32 -0400 Received: from localhost (localhost [127.0.0.1]) by mail-relay-1.csv.warwick.ac.uk (8.13.8/8.13.6) with ESMTP id p7QEwS2Y051338 for ; Fri, 26 Aug 2011 15:58:28 +0100 (BST) X-Virus-Scanned: amavisd-new at warwick.ac.uk Received: from mail-relay-1.csv.warwick.ac.uk ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WPIUN7iKwEAE for ; Fri, 26 Aug 2011 15:58:26 +0100 (BST) Received: from [137.205.191.9] (wonky [137.205.191.9]) by mail-relay-1.csv.warwick.ac.uk (8.13.8/8.13.6) with ESMTP id p7QEwPE7051287 for ; Fri, 26 Aug 2011 15:58:26 +0100 (BST) X-Envelope-From: Rob.McMahon@warwick.ac.uk Message-ID: <4E57B491.9000402@warwick.ac.uk> Date: Fri, 26 Aug 2011 15:58:25 +0100 From: Rob McMahon User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:6.0) Gecko/20110814 Thunderbird/6.0 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Compilation problems with coreutils-8.9 Content-Type: multipart/mixed; boundary="------------050204080102000802040308" X-DCC-Warwick-Metrics: bluebell 1333; Body=1 Fuz1=1 Fuz2=1 X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 26 Aug 2011 12:11:46 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) This is a multi-part message in MIME format. --------------050204080102000802040308 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I suspect you're going to say "upgrade to a more modern compiler" for most of these patches, but I had cause to install a later coreutils on an old box where this is not a viable option, running cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18 There are many uses of later C compilers to accept declarations intermingled with statements, which are not supported by this compiler. The attached diffs fix all these problems. Many of them are just swapping a couple of lines, which is probably worth it in the interests of compatibility. Rob -- E-Mail: Rob.McMahon@warwick.ac.uk PHONE: +44 24 7652 3037 Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England --------------050204080102000802040308 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="diffs" diff -ru1 dist/coreutils-8.9/lib/heap.c coreutils-8.9/lib/heap.c --- dist/coreutils-8.9/lib/heap.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/lib/heap.c 2011-08-25 10:19:13.940953000 +0100 @@ -95,2 +95,4 @@ { + void *top; + if (heap->count == 0) @@ -98,3 +100,3 @@ - void *top = heap->array[1]; + top = heap->array[1]; heap->array[1] = heap->array[heap->count--]; diff -ru1 dist/coreutils-8.9/src/chroot.c coreutils-8.9/src/chroot.c --- dist/coreutils-8.9/src/chroot.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/chroot.c 2011-08-25 10:24:47.462712000 +0100 @@ -153,2 +153,3 @@ char const *groups = NULL; + bool fail; @@ -213,3 +214,3 @@ - bool fail = false; + fail = false; diff -ru1 dist/coreutils-8.9/src/copy.c coreutils-8.9/src/copy.c --- dist/coreutils-8.9/src/copy.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/copy.c 2011-08-25 10:26:23.581904000 +0100 @@ -2278,2 +2278,3 @@ { + bool first_dir_created_per_command_line_arg; assert (valid_options (options)); @@ -2290,3 +2291,3 @@ - bool first_dir_created_per_command_line_arg = false; + first_dir_created_per_command_line_arg = false; return copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL, diff -ru1 dist/coreutils-8.9/src/csplit.c coreutils-8.9/src/csplit.c --- dist/coreutils-8.9/src/csplit.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/csplit.c 2011-08-25 11:21:12.885525000 +0100 @@ -1202,4 +1202,5 @@ int flags = 0; + size_t count; - for (size_t count = 0; ; count++) + for (count = 0; ; count++) { @@ -1277,6 +1278,9 @@ bool percent = false; + char *f; + int maxlen; - for (char *f = format; *f; f++) + for (f = format; *f; f++) if (*f == '%' && *++f != '%') { + int flags; if (percent) @@ -1285,3 +1289,2 @@ percent = true; - int flags; f += get_format_flags (f, &flags); @@ -1299,3 +1302,3 @@ - int maxlen = snprintf (NULL, 0, format, UINT_MAX); + maxlen = snprintf (NULL, 0, format, UINT_MAX); if (! (0 <= maxlen && maxlen <= SIZE_MAX)) @@ -1374,2 +1377,3 @@ + { size_t prefix_len = strlen (prefix); @@ -1382,2 +1386,3 @@ filename_space = xmalloc (prefix_len + max_digit_string_len + 1); + } diff -ru1 dist/coreutils-8.9/src/dd.c coreutils-8.9/src/dd.c --- dist/coreutils-8.9/src/dd.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/dd.c 2011-08-25 10:59:44.159093000 +0100 @@ -842,2 +842,4 @@ int old_flags = fcntl (STDOUT_FILENO, F_GETFL); + off_t off; + if (fcntl (STDOUT_FILENO, F_SETFL, old_flags & ~O_DIRECT) != 0) @@ -851,3 +853,3 @@ posix_fadvise failure. */ - off_t off = lseek (STDOUT_FILENO, 0, SEEK_CUR); + off = lseek (STDOUT_FILENO, 0, SEEK_CUR); if (0 <= off) diff -ru1 dist/coreutils-8.9/src/du.c coreutils-8.9/src/du.c --- dist/coreutils-8.9/src/du.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/du.c 2011-08-25 11:44:24.472799000 +0100 @@ -432,4 +432,5 @@ { + FTSENT const *e; fts_set (fts, ent, FTS_AGAIN); - FTSENT const *e = fts_read (fts); + e = fts_read (fts); assert (e == ent); @@ -455,4 +456,5 @@ { + FTSENT const *e; fts_set (fts, ent, FTS_SKIP); - FTSENT const *e = fts_read (fts); + e = fts_read (fts); assert (e == ent); @@ -623,2 +625,5 @@ + static char *temp_argv[] = { NULL, NULL }; + struct argv_iterator *ai; + cwd_only[0] = bad_cast ("."); @@ -866,3 +871,2 @@ - struct argv_iterator *ai; if (files_from) @@ -914,3 +918,2 @@ bit_flags |= symlink_deref_bits; - static char *temp_argv[] = { NULL, NULL }; diff -ru1 dist/coreutils-8.9/src/expr.c coreutils-8.9/src/expr.c --- dist/coreutils-8.9/src/expr.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/expr.c 2011-08-25 11:23:09.719524000 +0100 @@ -118,4 +118,4 @@ { - (void) str; (void) base; char buf[INT_BUFSIZE_BOUND (intmax_t)]; + (void) str; (void) base; return xstrdup (imaxtostr (z[0], buf)); @@ -140,4 +140,4 @@ { - (void) base; char buf[INT_BUFSIZE_BOUND (intmax_t)]; + (void) base; return fputs (imaxtostr (z[0], buf), stream) != EOF; diff -ru1 dist/coreutils-8.9/src/getlimits.c coreutils-8.9/src/getlimits.c --- dist/coreutils-8.9/src/getlimits.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/getlimits.c 2011-08-25 11:32:51.328096000 +0100 @@ -90,2 +90,4 @@ char *p = absnum + strlen (absnum); + char *result; + absnum[-1] = '0'; @@ -94,3 +96,3 @@ ++*p; - char *result = MIN (absnum, p); + result = MIN (absnum, p); if (negative) diff -ru1 dist/coreutils-8.9/src/join.c coreutils-8.9/src/join.c --- dist/coreutils-8.9/src/join.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/join.c 2011-08-25 11:04:36.004207000 +0100 @@ -713,2 +713,3 @@ + { /* If the user did not specify --check-order, then we read the @@ -754,2 +755,3 @@ free (line); + } diff -ru1 dist/coreutils-8.9/src/ls.c coreutils-8.9/src/ls.c --- dist/coreutils-8.9/src/ls.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/ls.c 2011-08-25 11:47:04.872791000 +0100 @@ -1034,9 +1034,10 @@ #ifdef HAVE_NL_LANGINFO - required_mon_width = MAX_MON_WIDTH; size_t curr_max_width; + required_mon_width = MAX_MON_WIDTH; do { + int i; curr_max_width = required_mon_width; required_mon_width = 0; - for (int i = 0; i < 12; i++) + for (i = 0; i < 12; i++) { @@ -3464,2 +3465,4 @@ const char *pb; + size_t ret; + if (required_mon_width && (pb = strstr (fmt, "%b"))) @@ -3476,3 +3479,3 @@ } - size_t ret = nstrftime (buf, size, nfmt, tm, __utc, __ns); + ret = nstrftime (buf, size, nfmt, tm, __utc, __ns); return ret; @@ -3623,3 +3626,3 @@ ]; - size_t s; + size_t s, w; char *p; @@ -3813,3 +3816,3 @@ DIRED_FPUTS (buf, stdout, p - buf); - size_t w = print_name_with_quoting (f, false, &dired_obstack, p - buf); + w = print_name_with_quoting (f, false, &dired_obstack, p - buf); @@ -4001,2 +4004,3 @@ { + size_t width; const char* name = symlink_target ? f->linkname : f->name; @@ -4011,3 +4015,3 @@ - size_t width = quote_name (stdout, name, filename_quoting_options, NULL); + width = quote_name (stdout, name, filename_quoting_options, NULL); dired_pos += width; @@ -4049,2 +4053,3 @@ char buf[MAX (LONGEST_HUMAN_READABLE + 1, INT_BUFSIZE_BOUND (uintmax_t))]; + size_t width; @@ -4065,3 +4070,3 @@ - size_t width = print_name_with_quoting (f, false, NULL, start_col); + width = print_name_with_quoting (f, false, NULL, start_col); diff -ru1 dist/coreutils-8.9/src/nproc.c coreutils-8.9/src/nproc.c --- dist/coreutils-8.9/src/nproc.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/nproc.c 2011-08-25 11:06:38.550677000 +0100 @@ -78,2 +78,4 @@ unsigned long nproc, ignore = 0; + enum nproc_query mode; + initialize_main (&argc, &argv); @@ -86,3 +88,3 @@ - enum nproc_query mode = NPROC_CURRENT_OVERRIDABLE; + mode = NPROC_CURRENT_OVERRIDABLE; diff -ru1 dist/coreutils-8.9/src/od.c coreutils-8.9/src/od.c --- dist/coreutils-8.9/src/od.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/od.c 2011-08-25 11:24:52.628883000 +0100 @@ -594,2 +594,4 @@ int field_width; + struct lconv const *locale; + size_t decimal_point_len; @@ -773,4 +775,4 @@ - struct lconv const *locale = localeconv (); - size_t decimal_point_len = + locale = localeconv (); + decimal_point_len = (locale->decimal_point[0] ? strlen (locale->decimal_point) : 1); diff -ru1 dist/coreutils-8.9/src/remove.c coreutils-8.9/src/remove.c --- dist/coreutils-8.9/src/remove.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/remove.c 2011-08-25 12:00:00.112933000 +0100 @@ -173,2 +173,4 @@ native or /proc/self/fd allows us to skip a chdir. */ + size_t file_name_len; + if (!openat_needs_fchdir ()) @@ -182,3 +184,3 @@ /* This implements #5: */ - size_t file_name_len = strlen (full_name); + file_name_len = strlen (full_name); @@ -221,11 +223,12 @@ char const *filename = ent->fts_accpath; - if (is_empty_p) - *is_empty_p = T_UNKNOWN; - struct stat st; struct stat *sbuf = &st; - cache_stat_init (sbuf); - int dirent_type = is_dir ? DT_DIR : DT_UNKNOWN; int write_protected = 0; + int wp_errno = 0; + + if (is_empty_p) + *is_empty_p = T_UNKNOWN; + + cache_stat_init (sbuf); @@ -240,3 +243,2 @@ - int wp_errno = 0; if (!x->ignore_missing_files @@ -252,2 +254,5 @@ { + char const *quoted_name; + bool is_empty; + if (0 <= write_protected && dirent_type == DT_UNKNOWN) @@ -288,3 +293,3 @@ - char const *quoted_name = quote (full_name); + quoted_name = quote (full_name); @@ -296,3 +301,2 @@ - bool is_empty; if (is_empty_p) @@ -545,2 +549,4 @@ { + bool is_dir; + enum RM_status s; /* With --one-file-system, do not attempt to remove a mount point. @@ -559,4 +565,4 @@ - bool is_dir = ent->fts_info == FTS_DP || ent->fts_info == FTS_DNR; - enum RM_status s = prompt (fts, ent, is_dir, x, PA_REMOVE_DIR, NULL); + is_dir = ent->fts_info == FTS_DP || ent->fts_info == FTS_DNR; + s = prompt (fts, ent, is_dir, x, PA_REMOVE_DIR, NULL); if (s != RM_OK) @@ -601,2 +607,4 @@ | FTS_PHYSICAL); + FTS *fts; + enum RM_status s; @@ -605,3 +613,3 @@ - FTS *fts = xfts_open (file, bit_flags, NULL); + fts = xfts_open (file, bit_flags, NULL); @@ -622,3 +630,3 @@ - enum RM_status s = rm_fts (fts, ent, x); + s = rm_fts (fts, ent, x); diff -ru1 dist/coreutils-8.9/src/rm.c coreutils-8.9/src/rm.c --- dist/coreutils-8.9/src/rm.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/rm.c 2011-08-25 11:09:19.854004000 +0100 @@ -328,4 +328,6 @@ + { size_t n_files = argc - optind; char **file = argv + optind; + enum RM_status status; @@ -342,5 +344,6 @@ - enum RM_status status = rm (file, &x); + status = rm (file, &x); assert (VALID_STATUS (status)); exit (status == RM_ERROR ? EXIT_FAILURE : EXIT_SUCCESS); + } } diff -ru1 dist/coreutils-8.9/src/seq.c coreutils-8.9/src/seq.c --- dist/coreutils-8.9/src/seq.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/seq.c 2011-08-25 11:25:38.840888000 +0100 @@ -149,2 +149,3 @@ { + char const *e; char const *decimal_point = strchr (arg, '.'); @@ -162,3 +163,3 @@ } - char const *e = strchr (arg, 'e'); + e = strchr (arg, 'e'); if (! e) @@ -316,2 +317,4 @@ size_t last_width = last.width + (prec - last.precision); + size_t width; + if (last.precision && prec == 0) @@ -320,3 +323,3 @@ last_width++; /* include space for '.' */ - size_t width = MAX (first_width, last_width); + width = MAX (first_width, last_width); if (width <= INT_MAX) diff -ru1 dist/coreutils-8.9/src/shred.c coreutils-8.9/src/shred.c --- dist/coreutils-8.9/src/shred.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/shred.c 2011-08-25 11:29:19.408081000 +0100 @@ -470,3 +470,3 @@ SECTOR_SIZE, except at the end. */ - verify (sizeof r % SECTOR_SIZE == 0); + verify_true (sizeof r % SECTOR_SIZE == 0); if (errnum == EIO && 0 <= size && (soff | SECTOR_MASK) < lim) diff -ru1 dist/coreutils-8.9/src/sort.c coreutils-8.9/src/sort.c --- dist/coreutils-8.9/src/sort.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/sort.c 2011-08-25 12:11:46.492528000 +0100 @@ -730,5 +730,6 @@ struct tempnode test; + struct tempnode *node; test.pid = pid; - struct tempnode *node = hash_delete (proctab, &test); + node = hash_delete (proctab, &test); if (! node) @@ -1116,2 +1117,3 @@ FILE *fp = NULL; + pid_t child; @@ -1124,3 +1126,3 @@ - pid_t child = pipe_fork (pipefds, MAX_FORK_TRIES_DECOMPRESS); + child = pipe_fork (pipefds, MAX_FORK_TRIES_DECOMPRESS); @@ -1880,2 +1882,4 @@ { + int diff; + while (blanks[to_uchar (*a)]) @@ -1885,3 +1889,3 @@ - int diff = find_unit_order (a) - find_unit_order (b); + diff = find_unit_order (a) - find_unit_order (b); return (diff ? diff : strnumcmp (a, b, decimal_point, thousands_sep)); @@ -1999,4 +2003,6 @@ { + size_t translated_size; + errno = 0; - size_t translated_size = strxfrm (dest, src, destsize); + translated_size = strxfrm (dest, src, destsize); @@ -2027,3 +2033,3 @@ int xfrm_diff = 0; - + int diff; char stackbuf[4000]; @@ -2059,2 +2065,5 @@ size_t guess_bufsize = 3 * (lena + lenb) + 2; + size_t sizea, sizeb; + bool a_fits; + if (bufsize < guess_bufsize) @@ -2071,6 +2080,6 @@ - size_t sizea = + sizea = (texta < lima ? xstrxfrm (buf, texta, bufsize) + 1 : 0); - bool a_fits = sizea <= bufsize; - size_t sizeb = + a_fits = sizea <= bufsize; + sizeb = (textb < limb @@ -2127,3 +2136,3 @@ md5_process_bytes (textb, lenb, &s[1]); md5_finish_ctx (&s[1], dig[1]); - int diff = memcmp (dig[0], dig[1], sizeof dig[0]); + diff = memcmp (dig[0], dig[1], sizeof dig[0]); @@ -2198,2 +2207,3 @@ char *lim = text + line->length - 1; + size_t offset, width; @@ -2208,2 +2218,3 @@ { + char *tighter_lim; char saved = *lim; @@ -2214,3 +2225,3 @@ - char *tighter_lim = beg; + tighter_lim = beg; @@ -2248,4 +2259,4 @@ - size_t offset = debug_width (text, beg); - size_t width = debug_width (beg, lim); + offset = debug_width (text, beg); + width = debug_width (beg, lim); mark_key (offset, width); @@ -2323,2 +2334,6 @@ { + bool implicit_skip; + bool maybe_space_aligned; + bool line_offset; + if (key->obsolete_used) @@ -2357,6 +2372,6 @@ /* Warn about significant leading blanks. */ - bool implicit_skip = key_numeric (key) || key->month; - bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) + implicit_skip = key_numeric (key) || key->month; + maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) && !(key->schar || key->echar); - bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ + line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ if (!gkey_only && tab == TAB_DEFAULT && !line_offset @@ -2404,6 +2419,7 @@ bool ugkey_reverse = ugkey.reverse; - if (!(stable || unique)) - ugkey.reverse = false; /* The following is too big, but guaranteed to be "big enough". */ char opts[sizeof short_options]; + + if (!(stable || unique)) + ugkey.reverse = false; key_to_opts (&ugkey, opts); @@ -2440,2 +2456,3 @@ bool const *ignore = key->ignore; + size_t lena, lenb; @@ -2446,4 +2463,4 @@ /* Find the lengths. */ - size_t lena = lima - texta; - size_t lenb = limb - textb; + lena = lima - texta; + lenb = limb - textb; @@ -3116,2 +3133,4 @@ struct line *hi = lines - nlo; + struct line *dest; + struct line const *sorted_lo; @@ -3123,4 +3142,2 @@ - struct line *dest; - struct line const *sorted_lo; if (to_temp) @@ -3477,3 +3494,3 @@ /* Number of lines in LINES and DEST. */ - size_t const total_lines; + size_t total_lines; @@ -3722,2 +3739,4 @@ size_t nopened = open_input_files (files, nfiles, &fps); + FILE *tfp; + struct tempnode *temp; @@ -3742,4 +3761,2 @@ we closed and tried to create). */ - FILE *tfp; - struct tempnode *temp; do @@ -3838,6 +3855,8 @@ struct merge_node_queue queue; + struct merge_node *merge_tree; + struct merge_node *root; + queue_init (&queue, nthreads); - struct merge_node *merge_tree = - merge_tree_init (nthreads, buf.nlines, line); - struct merge_node *root = merge_tree + 1; + merge_tree = merge_tree_init (nthreads, buf.nlines, line); + root = merge_tree + 1; @@ -4608,2 +4627,4 @@ { + size_t nthreads_max; + if (!nthreads) @@ -4615,3 +4636,3 @@ /* Avoid integer overflow later. */ - size_t nthreads_max = SIZE_MAX / (2 * sizeof (struct merge_node)); + nthreads_max = SIZE_MAX / (2 * sizeof (struct merge_node)); nthreads = MIN (nthreads, nthreads_max); diff -ru1 dist/coreutils-8.9/src/split.c coreutils-8.9/src/split.c --- dist/coreutils-8.9/src/split.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/split.c 2011-08-25 11:30:28.566248000 +0100 @@ -454,7 +454,5 @@ { - assert (n && k <= n && n <= file_size); - - const off_t chunk_size = file_size / n; + off_t chunk_size; uintmax_t chunk_no = 1; - off_t chunk_end = chunk_size - 1; + off_t chunk_end; off_t n_written = 0; @@ -462,2 +460,7 @@ + assert (n && k <= n && n <= file_size); + + chunk_size = file_size / n; + chunk_end = chunk_size - 1; + if (k > 1) diff -ru1 dist/coreutils-8.9/src/stat.c coreutils-8.9/src/stat.c --- dist/coreutils-8.9/src/stat.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/stat.c 2011-08-25 12:02:51.677107000 +0100 @@ -544,2 +544,6 @@ int precision = 0; + int divisor; + int frac_sec; + int int_len; + int i; bool frac_left_adjust = false; @@ -566,2 +570,3 @@ later. */ + long int lwidth; char *p = dot; @@ -573,3 +578,3 @@ - long int lwidth = strtol (p, NULL, 10); + lwidth = strtol (p, NULL, 10); width = (lwidth <= INT_MAX ? lwidth : INT_MAX); @@ -577,5 +582,7 @@ { + int w_d; + p += (*p == '0'); sec_prefix_len = p - pformat; - int w_d = (decimal_point_len < width + w_d = (decimal_point_len < width ? width - decimal_point_len @@ -588,3 +595,4 @@ char *dst = pformat; - for (char const *src = dst; src < p; src++) + char const *src; + for (src = dst; src < p; src++) { @@ -604,7 +612,7 @@ - int divisor = 1; - for (int i = precision; i < 9; i++) + divisor = 1; + for (i = precision; i < 9; i++) divisor *= 10; - int frac_sec = arg.tv_nsec / divisor; - int int_len; + frac_sec = arg.tv_nsec / divisor; + int_len; @@ -759,2 +767,3 @@ char const * bind_mount = NULL; + struct mount_entry *me; @@ -769,3 +778,2 @@ - struct mount_entry *me; for (me = mount_list; me; me = me->me_next) @@ -844,6 +852,7 @@ { + struct timespec z = {0, 0}; if (0 <= ts.tv_nsec) return ts; - struct timespec z = {0, 0}; - return z; + else + return z; } @@ -1055,2 +1064,3 @@ { + unsigned int fmt_code; size_t len = strspn (b + 1, printf_flags); @@ -1061,3 +1071,3 @@ len = fmt_char - (b + 1); - unsigned int fmt_code = *fmt_char; + fmt_code = *fmt_char; memcpy (dest, b, len + 1); @@ -1149,2 +1159,3 @@ STRUCT_STATVFS statfsbuf; + bool fail; @@ -1164,3 +1175,3 @@ - bool fail = print_it (format, filename, print_statfs, &statfsbuf); + fail = print_it (format, filename, print_statfs, &statfsbuf); return ! fail; @@ -1174,2 +1185,3 @@ struct stat statbuf; + bool fail; @@ -1197,3 +1209,3 @@ - bool fail = print_it (format, filename, print_stat, &statbuf); + fail = print_it (format, filename, print_stat, &statbuf); return ! fail; @@ -1400,2 +1412,3 @@ bool ok = true; + struct lconv const *locale; @@ -1407,3 +1420,3 @@ - struct lconv const *locale = localeconv (); + locale = localeconv (); decimal_point = (locale->decimal_point[0] ? locale->decimal_point : "."); diff -ru1 dist/coreutils-8.9/src/system.h coreutils-8.9/src/system.h --- dist/coreutils-8.9/src/system.h 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/system.h 2011-08-25 10:23:36.641538000 +0100 @@ -595,2 +595,4 @@ { + const char *lc_messages; + printf (_("\nReport %s bugs to %s\n"), last_component (program_name), @@ -604,3 +606,3 @@ Note we still output for 'C' so that it gets included in the man page. */ - const char *lc_messages = setlocale (LC_MESSAGES, NULL); + lc_messages = setlocale (LC_MESSAGES, NULL); if (lc_messages && strncmp (lc_messages, "en_", 3)) diff -ru1 dist/coreutils-8.9/src/wc.c coreutils-8.9/src/wc.c --- dist/coreutils-8.9/src/wc.c 2011-01-01 21:19:23.000000000 +0000 +++ coreutils-8.9/src/wc.c 2011-08-25 11:42:53.969485000 +0100 @@ -592,4 +592,6 @@ bool ok; + bool read_tokens; int optc; int nfiles; + int i; char **files; @@ -598,2 +600,3 @@ struct Tokens tok; + struct argv_iterator *ai; @@ -654,4 +657,3 @@ - bool read_tokens = false; - struct argv_iterator *ai; + read_tokens = false; if (files_from) @@ -659,2 +661,3 @@ FILE *stream; + struct stat st; @@ -682,3 +685,2 @@ size is reasonable. Otherwise, we'll read a name at a time. */ - struct stat st; if (fstat (fileno (stream), &st) == 0 @@ -714,3 +716,2 @@ - int i; ok = true; --------------050204080102000802040308-- ------------=_1314375663-9944-1-- From unknown Sun Jun 22 07:47:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9380: Compilation problems with coreutils-8.9 Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 26 Aug 2011 16:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9380 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Rob McMahon Cc: 9380@debbugs.gnu.org Received: via spool by 9380-submit@debbugs.gnu.org id=B9380.131437633813607 (code B ref 9380); Fri, 26 Aug 2011 16:33:02 +0000 Received: (at 9380) by debbugs.gnu.org; 26 Aug 2011 16:32:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwzKL-0003XQ-R8 for submit@debbugs.gnu.org; Fri, 26 Aug 2011 12:32:18 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwzKJ-0003XI-DK for 9380@debbugs.gnu.org; Fri, 26 Aug 2011 12:32:16 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id CD861A60002; Fri, 26 Aug 2011 09:29:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qSJvuOrX+ng9; Fri, 26 Aug 2011 09:29:28 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 705F1A60001; Fri, 26 Aug 2011 09:29:28 -0700 (PDT) Message-ID: <4E57C9E1.2010709@cs.ucla.edu> Date: Fri, 26 Aug 2011 09:29:21 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110805 Thunderbird/3.1.12 MIME-Version: 1.0 References: <4E57B491.9000402@warwick.ac.uk> In-Reply-To: <4E57B491.9000402@warwick.ac.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) Can't you compile with the -xc99 option? The Sun documentation says it's supported, even with that old compiler: http://developers.sun.com/sunstudio/support/Ccompare.html#upd2e 'configure' should have deduced the -xc99 option for you; it tries '-xc99=all' early on. Does that not work for you? The documentation says '-xc99=%all' is required, but as I recall, the '%' was optional even way back when. Perhaps you can send in a copy of your 'configure' command, and the resulting 'config.log' file? From unknown Sun Jun 22 07:47:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9380: Compilation problems with coreutils-8.9 Resent-From: Rob McMahon Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 30 Aug 2011 11:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9380 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert Cc: 9380@debbugs.gnu.org Received: via spool by 9380-submit@debbugs.gnu.org id=B9380.131470500132397 (code B ref 9380); Tue, 30 Aug 2011 11:50:03 +0000 Received: (at 9380) by debbugs.gnu.org; 30 Aug 2011 11:50:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QyMpM-0008QP-9n for submit@debbugs.gnu.org; Tue, 30 Aug 2011 07:50:00 -0400 Received: from mail-relay-1.csv.warwick.ac.uk ([137.205.128.7]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QyMpJ-0008QA-Az for 9380@debbugs.gnu.org; Tue, 30 Aug 2011 07:49:58 -0400 Received: from localhost (localhost [127.0.0.1]) by mail-relay-1.csv.warwick.ac.uk (8.13.8/8.13.6) with ESMTP id p7UBk9Js032955; Tue, 30 Aug 2011 12:46:28 +0100 (BST) X-Virus-Scanned: amavisd-new at warwick.ac.uk Received: from mail-relay-1.csv.warwick.ac.uk ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8lC9vqmZXEoR; Tue, 30 Aug 2011 12:46:08 +0100 (BST) Received: from [137.205.191.9] (wonky [137.205.191.9]) by mail-relay-1.csv.warwick.ac.uk (8.13.8/8.13.6) with ESMTP id p7UBk7m5032910; Tue, 30 Aug 2011 12:46:07 +0100 (BST) X-Envelope-From: Rob.McMahon@warwick.ac.uk Message-ID: <4E5CCD7E.2030506@warwick.ac.uk> Date: Tue, 30 Aug 2011 12:46:06 +0100 From: Rob McMahon User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:6.0) Gecko/20110814 Thunderbird/6.0 MIME-Version: 1.0 References: <4E57B491.9000402@warwick.ac.uk> <4E57C9E1.2010709@cs.ucla.edu> In-Reply-To: <4E57C9E1.2010709@cs.ucla.edu> Content-Type: multipart/alternative; boundary="------------060305070900040102080606" X-DCC-Warwick-Metrics: bluebell 1332; Body=2 Fuz1=2 Fuz2=2 X-Spam-Score: -6.3 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) This is a multi-part message in MIME format. --------------060305070900040102080606 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 26/08/2011 17:29, Paul Eggert wrote: > Can't you compile with the -xc99 option? The Sun documentation says it's > supported, even with that old compiler: > > http://developers.sun.com/sunstudio/support/Ccompare.html#upd2e > > 'configure' should have deduced the -xc99 option for you; it tries > '-xc99=all' early on. Does that not work for you? The documentation > says '-xc99=%all' is required, but as I recall, the '%' was optional > even way back when. > That doesn't seem to be quite enough unfortunately: > cc -V cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18 > dirs ~/src/gnu/dist/coreutils-8.9/lib > make -n heap.o echo " CC " heap.o;source='heap.c' object='heap.o' libtool=no \ DEPDIR=.deps depmode=none /bin/bash ../build-aux/depcomp \ cc -I. -D_REENTRANT -O -xc99=%all -c -o heap.o heap.c > make heap.o CC heap.o "heap.c", line 99: syntax error before or at: void "heap.c", line 103: undefined symbol: top "heap.c", line 103: warning: improper pointer/integer combination: op "=" cc: acomp failed for heap.c make: *** [heap.o] Error 2 Exit 2 > sed -n '96,103p' heap.c if (heap->count == 0) return NULL; void *top = heap->array[1]; heap->array[1] = heap->array[heap->count--]; heapify_down (heap->array, heap->count, 1, heap->compare); return top; > If you look at the list of supported C99 features, it's: * *C99 Keywords* * *__func__* *Support* * *Variable Length Arrays* * *inline* *Specifier For Static Functions* * *Commenting Code With //* No mixing of declarations with statements. Ah well, this should be the last time I have to do this. Rob -- E-Mail: Rob.McMahon@warwick.ac.uk PHONE: +44 24 7652 3037 Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England --------------060305070900040102080606 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mail-relay-1.csv.warwick.ac.uk id p7UBk9Js032955 On 26/08/2011 17:29, Paul Eggert wrote:
Can't you compile with the -xc99 option?  The Sun do=
cumentation says it's
supported, even with that old compiler:

http://developers.sun.com/sunstudio/su=
pport/Ccompare.html#upd2e

'configure' should have deduced the -xc99 option for you; it tries
'-xc99=3Dall' early on.  Does that not work for you?  The documentation
says '-xc99=3D%all' is required, but as I recall, the '%' was optional
even way back when.

That doesn't seem to be quite enough unfortunately:

> cc -V
cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18
> dirs
~/src/gnu/dist/coreutils-8.9/lib
> make -n heap.o
echo "=C2=A0 CC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 " heap.o;source=3D'he= ap.c' object=3D'heap.o' libtool=3Dno \
DEPDIR=3D.deps depmode=3Dnone /bin/bash ../build-aux/depcomp \
cc=C2=A0 -I.=C2=A0=C2=A0 -D_REENTRANT=C2=A0=C2=A0 -O -xc99=3D%all -= c -o heap.o heap.c
> make heap.o
=C2=A0 CC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 heap.o
"heap.c", line 99: syntax error before or at: void
"heap.c", line 103: undefined symbol: top
"heap.c", line 103: warning: improper pointer/integer combination: op "=3D"
cc: acomp failed for heap.c
make: *** [heap.o] Error 2
Exit 2
> sed -n '96,103p' heap.c
=C2=A0 if (heap->count =3D=3D 0)
=C2=A0=C2=A0=C2=A0 return NULL;

=C2=A0 void *top =3D heap->array[1];
=C2=A0 heap->array[1] =3D heap->array[heap->count--];
=C2=A0 heapify_down (heap->array, heap->count, 1, heap->compare);

=C2=A0 return top;
>


If you look at the list of supported C99 features, it's:

  • C99 Keywords
  • __func__ Support
  • Variable Length Arrays
  • inline Specifier For Static Functions
  • Commenting Code With //

No mixing of declarations with statements.=C2=A0 Ah well, this should= be the last time I have to do this.

Rob
--=20
E-Mail:	Rob.McMahon@warwick.ac.uk		PHONE:  +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England
--------------060305070900040102080606-- From unknown Sun Jun 22 07:47:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9380: Compilation problems with coreutils-8.9 Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 30 Aug 2011 14:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9380 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Rob McMahon Cc: Paul Eggert , 9380@debbugs.gnu.org Received: via spool by 9380-submit@debbugs.gnu.org id=B9380.131471557214579 (code B ref 9380); Tue, 30 Aug 2011 14:47:01 +0000 Received: (at 9380) by debbugs.gnu.org; 30 Aug 2011 14:46:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QyPZr-0003n5-04 for submit@debbugs.gnu.org; Tue, 30 Aug 2011 10:46:11 -0400 Received: from mail2.vodafone.ie ([213.233.128.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QyPZn-0003mv-Mt for 9380@debbugs.gnu.org; Tue, 30 Aug 2011 10:46:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBAFn2XE5tTk6J/2dsb2JhbAAMNg6EPqYBAQEFIwQLAUEFEAsNCwICBRYLAgIJAwIBAgFFBg0BBwEBh3KmS5ILgSyEEIERBJhQiyE5 Received: from unknown (HELO [192.168.1.79]) ([109.78.78.137]) by mail2.vodafone.ie with ESMTP; 30 Aug 2011 15:42:58 +0100 Message-ID: <4E5CF6F2.9070104@draigBrady.com> Date: Tue, 30 Aug 2011 15:42:58 +0100 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 References: <4E57B491.9000402@warwick.ac.uk> <4E57C9E1.2010709@cs.ucla.edu> <4E5CCD7E.2030506@warwick.ac.uk> In-Reply-To: <4E5CCD7E.2030506@warwick.ac.uk> X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 08/30/2011 12:46 PM, Rob McMahon wrote: > On 26/08/2011 17:29, Paul Eggert wrote: >> Can't you compile with the -xc99 option? The Sun documentation says it's >> supported, even with that old compiler: >> >> http://developers.sun.com/sunstudio/support/Ccompare.html#upd2e >> >> 'configure' should have deduced the -xc99 option for you; it tries >> '-xc99=all' early on. Does that not work for you? The documentation >> says '-xc99=%all' is required, but as I recall, the '%' was optional >> even way back when. >> > That doesn't seem to be quite enough unfortunately: > >> cc -V > cc: Sun WorkShop 6 update 2 C 5.3 Patch 111679-12 2003/05/18 >> dirs > ~/src/gnu/dist/coreutils-8.9/lib >> make -n heap.o > echo " CC " heap.o;source='heap.c' object='heap.o' libtool=no \ > DEPDIR=.deps depmode=none /bin/bash ../build-aux/depcomp \ > cc -I. -D_REENTRANT -O -xc99=%all -c -o heap.o heap.c >> make heap.o > CC heap.o > "heap.c", line 99: syntax error before or at: void > "heap.c", line 103: undefined symbol: top > "heap.c", line 103: warning: improper pointer/integer combination: op "=" > cc: acomp failed for heap.c > make: *** [heap.o] Error 2 > Exit 2 >> sed -n '96,103p' heap.c > if (heap->count == 0) > return NULL; > > void *top = heap->array[1]; > heap->array[1] = heap->array[heap->count--]; > heapify_down (heap->array, heap->count, 1, heap->compare); > > return top; I've just adjusted that for heap.c as that might be going to gnulib at some stage. However you'll need to use your patch for the rest of coreutils. http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=683ee76 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8977 cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 20 14:00:18 2011 Received: (at control) by debbugs.gnu.org; 20 Sep 2011 18:00:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R64cE-0001Nm-1X for submit@debbugs.gnu.org; Tue, 20 Sep 2011 14:00:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R64cA-0001HV-6g for control@debbugs.gnu.org; Tue, 20 Sep 2011 14:00:16 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8KHt5Ml011230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Sep 2011 13:55:05 -0400 Received: from [10.3.113.135] (ovpn-113-135.phx2.redhat.com [10.3.113.135]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8KHt4iN031217 for ; Tue, 20 Sep 2011 13:55:05 -0400 Message-ID: <4E78D378.3060907@redhat.com> Date: Tue, 20 Sep 2011 11:55:04 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.22) Gecko/20110906 Fedora/3.1.14-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.14 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: more work Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) tag 9507 notabug forcemerge 6394 9507 tag 9504 notabug tag 9449 notabug tag 9450 wishlist tag 9418 notabug tag 9380 notabug tag 9327 notabug tag 9326 notabug tag 9283 notabug tag 9281 notabug thanks -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org