diff -urN coreutils-8.5/lib/mbsalign.c coreutils-8.5-gcc2/lib/mbsalign.c --- coreutils-8.5/lib/mbsalign.c 2010-04-20 19:52:04.018350080 +0000 +++ coreutils-8.5-gcc2/lib/mbsalign.c 2010-09-24 13:26:41.000000000 +0000 @@ -140,6 +140,7 @@ size_t n_cols = src_size - 1; size_t n_used_bytes = n_cols; /* Not including NUL */ size_t n_spaces = 0; + size_t space_left; bool conversion = false; bool wc_enabled = false; @@ -238,7 +239,7 @@ } dest = mbs_align_pad (dest, dest_end, start_spaces); - size_t space_left = dest_end - dest; + space_left = dest_end - dest; dest = mempcpy (dest, str_to_print, MIN (n_used_bytes, space_left)); mbs_align_pad (dest, dest_end, end_spaces); } @@ -262,11 +263,12 @@ size_t size = *width; /* Start with enough for unibyte mode. */ size_t req = size; char *buf = NULL; + char *nbuf; while (req >= size) { size = req + 1; /* Space for NUL. */ - char *nbuf = realloc (buf, size); + nbuf = realloc (buf, size); if (nbuf == NULL) { free (buf); diff -urN coreutils-8.5/src/chroot.c coreutils-8.5-gcc2/src/chroot.c --- coreutils-8.5/src/chroot.c 2010-04-20 19:52:04.033030144 +0000 +++ coreutils-8.5-gcc2/src/chroot.c 2010-09-24 13:39:03.000000000 +0000 @@ -151,6 +151,7 @@ int c; char const *userspec = NULL; char const *groups = NULL; + bool fail; initialize_main (&argc, &argv); set_program_name (argv[0]); @@ -211,7 +212,7 @@ argv += optind + 1; } - bool fail = false; + fail = false; /* Attempt to set all three: supplementary groups, group ID, user ID. Diagnose any failures. If any have failed, exit before execvp. */ diff -urN coreutils-8.5/src/copy.c coreutils-8.5-gcc2/src/copy.c --- coreutils-8.5/src/copy.c 2010-04-20 19:52:04.049807360 +0000 +++ coreutils-8.5-gcc2/src/copy.c 2010-09-24 13:43:19.000000000 +0000 @@ -2280,6 +2280,7 @@ bool nonexistent_dst, const struct cp_options *options, bool *copy_into_self, bool *rename_succeeded) { + bool first_dir_created_per_command_line_arg = false; assert (valid_options (options)); /* Record the file names: they're used in case of error, when copying @@ -2292,7 +2293,6 @@ top_level_src_name = src_name; top_level_dst_name = dst_name; - bool first_dir_created_per_command_line_arg = false; return copy_internal (src_name, dst_name, nonexistent_dst, 0, NULL, options, true, &first_dir_created_per_command_line_arg, diff -urN coreutils-8.5/src/du.c coreutils-8.5-gcc2/src/du.c --- coreutils-8.5/src/du.c 2010-01-01 13:06:47.039321600 +0000 +++ coreutils-8.5-gcc2/src/du.c 2010-09-24 14:00:37.000000000 +0000 @@ -664,7 +664,9 @@ bool max_depth_specified = false; bool ok = true; char *files_from = NULL; - + struct argv_iterator *ai; + static char *temp_argv[] = { NULL, NULL }; + /* Bit flags that control how fts works. */ int bit_flags = FTS_TIGHT_CYCLE_CHECK | FTS_DEFER_STAT; @@ -918,7 +920,6 @@ } } - struct argv_iterator *ai; if (files_from) { /* When using --files0-from=F, you may not specify any files @@ -950,7 +951,6 @@ hash_init (); bit_flags |= symlink_deref_bits; - static char *temp_argv[] = { NULL, NULL }; while (true) { diff -urN coreutils-8.5/src/expr.c coreutils-8.5-gcc2/src/expr.c --- coreutils-8.5/src/expr.c 2010-03-13 15:14:09.039845888 +0000 +++ coreutils-8.5-gcc2/src/expr.c 2010-09-24 14:11:15.000000000 +0000 @@ -116,8 +116,8 @@ static char * mpz_get_str (char const *str, int base, mpz_t z) { - (void) str; (void) base; char buf[INT_BUFSIZE_BOUND (intmax_t)]; + (void) str; (void) base; return xstrdup (imaxtostr (z[0], buf)); } static int @@ -138,8 +138,8 @@ static int mpz_out_str (FILE *stream, int base, mpz_t z) { - (void) base; char buf[INT_BUFSIZE_BOUND (intmax_t)]; + (void) base; return fputs (imaxtostr (z[0], buf), stream) != EOF; } #endif diff -urN coreutils-8.5/src/join.c coreutils-8.5-gcc2/src/join.c --- coreutils-8.5/src/join.c 2010-04-20 19:52:04.033554432 +0000 +++ coreutils-8.5-gcc2/src/join.c 2010-09-24 14:13:58.000000000 +0000 @@ -616,7 +616,9 @@ struct seq seq1, seq2; int diff; bool eof1, eof2; - + struct line *line = NULL; + bool checktail = false; + /* Read the first line of each file. */ initseq (&seq1); getseq (fp1, &seq1, 1); @@ -711,8 +713,6 @@ tail ends of both inputs to verify that they are in order. We skip the rest of the tail once we have issued a warning for that file, unless we actually need to print the unpairable lines. */ - struct line *line = NULL; - bool checktail = false; if (check_input_order != CHECK_ORDER_DISABLED && !(issued_disorder_warning[0] && issued_disorder_warning[1])) diff -urN coreutils-8.5/src/libstdbuf.c coreutils-8.5-gcc2/src/libstdbuf.c --- coreutils-8.5/src/libstdbuf.c 2010-03-13 15:14:09.034340864 +0000 +++ coreutils-8.5-gcc2/src/libstdbuf.c 2010-09-24 15:13:11.000000000 +0000 @@ -96,7 +96,7 @@ else { setvbuf_mode = _IOFBF; - verify (SIZE_MAX <= ULONG_MAX); + { verify (SIZE_MAX <= ULONG_MAX); } size = strtoul (mode, NULL, 10); if (size > 0) { diff -urN coreutils-8.5/src/ls.c coreutils-8.5-gcc2/src/ls.c --- coreutils-8.5/src/ls.c 2010-04-20 19:52:04.038273024 +0000 +++ coreutils-8.5-gcc2/src/ls.c 2010-09-24 13:54:45.000000000 +0000 @@ -1039,17 +1039,21 @@ abmon_init (void) { #ifdef HAVE_NL_LANGINFO - required_mon_width = MAX_MON_WIDTH; + int i; + size_t width; + size_t req; size_t curr_max_width; + required_mon_width = MAX_MON_WIDTH; + do { curr_max_width = required_mon_width; required_mon_width = 0; - for (int i = 0; i < 12; i++) + for (i = 0; i < 12; i++) { - size_t width = curr_max_width; + width = curr_max_width; - size_t req = mbsalign (nl_langinfo (ABMON_1 + i), + req = mbsalign (nl_langinfo (ABMON_1 + i), abmon[i], sizeof (abmon[i]), &width, MBS_ALIGN_LEFT, 0); @@ -3476,6 +3480,7 @@ the replacement is not done. A malloc here slows ls down by 2% */ char rpl_fmt[sizeof (abmon[0]) + 100]; const char *pb; + size_t ret; if (required_mon_width && (pb = strstr (fmt, "%b"))) { if (strlen (fmt) < (sizeof (rpl_fmt) - sizeof (abmon[0]) + 2)) @@ -3488,7 +3493,7 @@ strcpy (pfmt, pb + 2); } } - size_t ret = nstrftime (buf, size, nfmt, tm, __utc, __ns); + ret = nstrftime (buf, size, nfmt, tm, __utc, __ns); return ret; } @@ -3639,6 +3644,7 @@ char *p; struct timespec when_timespec; struct tm *when_local; + size_t w; /* Compute the mode string, except remove the trailing space if no file in this directory has an ACL or SELinux security context. */ @@ -3825,7 +3831,7 @@ } 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); if (f->filetype == symbolic_link) { @@ -4014,7 +4020,8 @@ size_t start_col) { const char* name = symlink_target ? f->linkname : f->name; - + size_t width; + bool used_color_this_time = (print_with_color && (print_color_indicator (f, symlink_target) @@ -4023,7 +4030,7 @@ if (stack) PUSH_CURRENT_DIRED_POS (stack); - size_t width = quote_name (stdout, name, filename_quoting_options, NULL); + width = quote_name (stdout, name, filename_quoting_options, NULL); dired_pos += width; if (stack) @@ -4060,6 +4067,7 @@ static size_t print_file_name_and_frills (const struct fileinfo *f, size_t start_col) { + size_t width; char buf[MAX (LONGEST_HUMAN_READABLE + 1, INT_BUFSIZE_BOUND (uintmax_t))]; set_normal_color (); @@ -4077,7 +4085,7 @@ if (print_scontext) printf ("%*s ", format == with_commas ? 0 : scontext_width, f->scontext); - size_t width = print_name_with_quoting (f, false, NULL, start_col); + width = print_name_with_quoting (f, false, NULL, start_col); if (indicator_style != none) width += print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype); diff -urN coreutils-8.5/src/nproc.c coreutils-8.5-gcc2/src/nproc.c --- coreutils-8.5/src/nproc.c 2010-01-01 13:06:47.032505856 +0000 +++ coreutils-8.5-gcc2/src/nproc.c 2010-09-24 14:41:24.000000000 +0000 @@ -76,6 +76,7 @@ main (int argc, char **argv) { unsigned long nproc, ignore = 0; + enum nproc_query mode; initialize_main (&argc, &argv); set_program_name (argv[0]); setlocale (LC_ALL, ""); @@ -84,7 +85,7 @@ atexit (close_stdout); - enum nproc_query mode = NPROC_CURRENT_OVERRIDABLE; + mode = NPROC_CURRENT_OVERRIDABLE; while (1) { diff -urN coreutils-8.5/src/remove.c coreutils-8.5-gcc2/src/remove.c --- coreutils-8.5/src/remove.c 2010-03-13 15:14:09.049020928 +0000 +++ coreutils-8.5-gcc2/src/remove.c 2010-09-24 14:39:23.000000000 +0000 @@ -114,6 +114,7 @@ char const *full_name, struct stat *buf) { + size_t file_name_len; if (can_write_any_file ()) return 0; if (cache_fstatat (fd_cwd, file, buf, AT_SYMLINK_NOFOLLOW) != 0) @@ -180,7 +181,7 @@ } /* This implements #5: */ - size_t file_name_len = strlen (full_name); + file_name_len = strlen (full_name); if (MIN (PATH_MAX, 8192) <= file_name_len) return ! euidaccess_stat (buf, W_OK); @@ -218,16 +219,21 @@ { int fd_cwd = fts->fts_cwd_fd; char const *full_name = ent->fts_path; + char const *quoted_name = quote (full_name); char const *filename = ent->fts_accpath; + struct stat st; + struct stat *sbuf = &st; + bool is_empty; + int dirent_type; + int write_protected = 0; + int wp_errno = 0; + 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; + dirent_type = is_dir ? DT_DIR : DT_UNKNOWN; /* When nonzero, this indicates that we failed to remove a child entry, either because the user declined an interactive prompt, or due to @@ -238,7 +244,6 @@ if (x->interactive == RMI_NEVER) return RM_OK; - int wp_errno = 0; if (!x->ignore_missing_files && ((x->interactive == RMI_ALWAYS) || x->stdin_tty) && dirent_type != DT_LNK) @@ -286,15 +291,12 @@ break; } - char const *quoted_name = quote (full_name); - if (write_protected < 0) { error (0, wp_errno, _("cannot remove %s"), quoted_name); return RM_ERROR; } - bool is_empty; if (is_empty_p) { is_empty = is_empty_dir (fd_cwd, filename); @@ -473,6 +475,8 @@ static enum RM_status rm_fts (FTS *fts, FTSENT *ent, struct rm_options const *x) { + bool is_dir; + enum RM_status s; switch (ent->fts_info) { case FTS_D: /* preorder directory */ @@ -557,8 +561,8 @@ return RM_ERROR; } - 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) return s; return excise (fts, ent, x, is_dir); @@ -593,6 +597,8 @@ rm (char *const *file, struct rm_options const *x) { enum RM_status rm_status = RM_OK; + FTS *fts; + enum RM_status s; if (*file) { @@ -603,7 +609,7 @@ if (x->one_file_system) bit_flags |= FTS_XDEV; - FTS *fts = xfts_open (file, bit_flags, NULL); + fts = xfts_open (file, bit_flags, NULL); while (1) { @@ -620,7 +626,7 @@ break; } - enum RM_status s = rm_fts (fts, ent, x); + s = rm_fts (fts, ent, x); assert (VALID_STATUS (s)); UPDATE_STATUS (rm_status, s); diff -urN coreutils-8.5/src/rm.c coreutils-8.5-gcc2/src/rm.c --- coreutils-8.5/src/rm.c 2010-04-20 19:52:05.032768000 +0000 +++ coreutils-8.5-gcc2/src/rm.c 2010-09-24 14:46:12.000000000 +0000 @@ -208,6 +208,9 @@ struct rm_options x; bool prompt_once = false; int c; + size_t n_files; + char **file; + enum RM_status status; initialize_main (&argc, &argv); set_program_name (argv[0]); @@ -334,8 +337,8 @@ quote ("/")); } - size_t n_files = argc - optind; - char **file = argv + optind; + n_files = argc - optind; + file = argv + optind; if (prompt_once && (x.recursive || 3 < n_files)) { @@ -348,7 +351,7 @@ exit (EXIT_SUCCESS); } - enum RM_status status = rm (file, &x); + status = rm (file, &x); assert (VALID_STATUS (status)); exit (status == RM_ERROR ? EXIT_FAILURE : EXIT_SUCCESS); } diff -urN coreutils-8.5/src/seq.c coreutils-8.5-gcc2/src/seq.c --- coreutils-8.5/src/seq.c 2010-01-01 13:06:47.036175872 +0000 +++ coreutils-8.5-gcc2/src/seq.c 2010-09-24 14:50:32.000000000 +0000 @@ -132,6 +132,7 @@ scan_arg (const char *arg) { operand ret; + char const *e; if (! xstrtold (arg, NULL, &ret.value, c_strtold)) { @@ -161,7 +162,7 @@ : (decimal_point == arg /* .# -> 0.# */ || ! ISDIGIT (decimal_point[-1]))); /* -.# -> 0.# */ } - char const *e = strchr (arg, 'e'); + e = strchr (arg, 'e'); if (! e) e = strchr (arg, 'E'); if (e) @@ -311,6 +312,7 @@ { if (equal_width) { + size_t width; /* increase first_width by any increased precision in step */ size_t first_width = first.width + (prec - first.precision); /* adjust last_width to use precision from first/step */ @@ -319,7 +321,7 @@ last_width--; /* don't include space for '.' */ if (last.precision == 0 && prec) last_width++; /* include space for '.' */ - size_t width = MAX (first_width, last_width); + width = MAX (first_width, last_width); if (width <= INT_MAX) { int w = width; diff -urN coreutils-8.5/src/shred.c coreutils-8.5-gcc2/src/shred.c --- coreutils-8.5/src/shred.c 2010-01-01 13:06:47.035651584 +0000 +++ coreutils-8.5-gcc2/src/shred.c 2010-09-24 14:58:02.000000000 +0000 @@ -468,7 +468,7 @@ out. Thus, it shouldn't give up on bad blocks. This code works because lim is always a multiple of SECTOR_SIZE, except at the end. */ - verify (sizeof r % SECTOR_SIZE == 0); + { verify (sizeof r % SECTOR_SIZE == 0); } if (errnum == EIO && 0 <= size && (soff | SECTOR_MASK) < lim) { size_t soff1 = (soff | SECTOR_MASK) + 1; diff -urN coreutils-8.5/src/sort.c coreutils-8.5-gcc2/src/sort.c --- coreutils-8.5/src/sort.c 2010-04-21 07:06:17.044040192 +0000 +++ coreutils-8.5-gcc2/src/sort.c 2010-09-24 15:04:51.000000000 +0000 @@ -1794,6 +1794,7 @@ const unsigned char *p = number; + int order; int sign = 1; if (*p == '-') @@ -1818,7 +1819,7 @@ p += 2; } - int order = orders[*p]; + order = orders[*p]; /* For valid units check for MiB vs MB etc. */ if (order) @@ -1835,13 +1836,16 @@ static int human_numcompare (const char *a, const char *b, struct keyfield *key) { + int order_a; + int order_b; + while (blanks[to_uchar (*a)]) a++; while (blanks[to_uchar (*b)]) b++; - int order_a = find_unit_order (a, key); - int order_b = find_unit_order (b, key); + order_a = find_unit_order (a, key); + order_b = find_unit_order (b, key); return (order_a > order_b ? 1 : order_a < order_b ? -1 @@ -2081,6 +2085,8 @@ for (;;) { + size_t lena; + size_t lenb; char const *translate = key->translate; bool const *ignore = key->ignore; @@ -2089,8 +2095,8 @@ limb = MAX (textb, limb); /* Find the lengths. */ - size_t lena = lima - texta; - size_t lenb = limb - textb; + lena = lima - texta; + lenb = limb - textb; /* Actually compare the fields. */ @@ -2879,6 +2885,9 @@ { /* Merge directly into the output file if possible. */ FILE **fps; + FILE *tfp; + pid_t pid; + char *temp; size_t nopened = open_input_files (files, nfiles, &fps); if (nopened == nfiles) @@ -2900,9 +2909,6 @@ file with our spare file descriptor. Retry if that failed (e.g., some other process could open a file between the time we closed and tried to create). */ - FILE *tfp; - pid_t pid; - char *temp; do { nopened--; diff -urN coreutils-8.5/src/system.h coreutils-8.5-gcc2/src/system.h --- coreutils-8.5/src/system.h 2010-04-20 19:52:05.040108032 +0000 +++ coreutils-8.5-gcc2/src/system.h 2010-09-24 13:37:18.000000000 +0000 @@ -585,6 +585,7 @@ static inline void emit_ancillary_info (void) { + const char *lc_messages; printf (_("\nReport %s bugs to %s\n"), last_component (program_name), PACKAGE_BUGREPORT); /* FIXME 2010: use AC_PACKAGE_URL once we require autoconf-2.64 */ @@ -594,7 +595,7 @@ stdout); /* Don't output this redundant message for English locales. 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)) { /* TRANSLATORS: Replace LANG_CODE in this URL with your language code diff -urN coreutils-8.5/src/tac.c coreutils-8.5-gcc2/src/tac.c --- coreutils-8.5/src/tac.c 2010-03-13 15:14:09.040632320 +0000 +++ coreutils-8.5-gcc2/src/tac.c 2010-09-24 15:06:41.000000000 +0000 @@ -572,6 +572,7 @@ were specified on the command line. */ static char const *const default_file_list[] = {"-", NULL}; char const *const *file; + void *buf; initialize_main (&argc, &argv); set_program_name (argv[0]); @@ -633,7 +634,7 @@ if (! (read_size < half_buffer_size && half_buffer_size < G_buffer_size)) xalloc_die (); G_buffer = xmalloc (G_buffer_size); - void *buf = G_buffer; + buf = G_buffer; if (sentinel_length) { strcpy (G_buffer, separator); diff -urN coreutils-8.5/src/wc.c coreutils-8.5-gcc2/src/wc.c --- coreutils-8.5/src/wc.c 2010-04-20 19:52:05.035127296 +0000 +++ coreutils-8.5-gcc2/src/wc.c 2010-09-24 15:11:46.000000000 +0000 @@ -584,12 +584,15 @@ main (int argc, char **argv) { bool ok; + int i; int optc; int nfiles; char **files; char *files_from = NULL; struct fstatus *fstatus; struct Tokens tok; + bool read_tokens = false; + struct argv_iterator *ai; initialize_main (&argc, &argv); set_program_name (argv[0]); @@ -646,11 +649,10 @@ || print_linelength)) print_lines = print_words = print_bytes = true; - bool read_tokens = false; - struct argv_iterator *ai; if (files_from) { FILE *stream; + struct stat st; /* When using --files0-from=F, you may not specify any files on the command-line. */ @@ -674,7 +676,6 @@ /* Read the file list into RAM if we can detect its size and that size is reasonable. Otherwise, we'll read a name at a time. */ - struct stat st; if (fstat (fileno (stream), &st) == 0 && S_ISREG (st.st_mode) && st.st_size <= MIN (10 * 1024 * 1024, physmem_available () / 2)) @@ -706,7 +707,6 @@ fstatus = get_input_fstatus (nfiles, files); number_width = compute_number_width (nfiles, fstatus); - int i; ok = true; for (i = 0; /* */; i++) {