bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint: avoid new unused-macro warnings from gcc


From: Jim Meyering
Subject: [PATCH] maint: avoid new unused-macro warnings from gcc
Date: Fri, 06 Mar 2009 11:52:48 +0100

Building on just-updated rawhide, I saw a bunch of new failures due to
warnings (treated as errors via -Werror) from the latest version of gcc.
This makes "make" complete without error once again:

>From 8b638f994abefde84746b3d8a08893c9ffeb7799 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 6 Mar 2009 10:49:18 +0100
Subject: [PATCH] maint: avoid new unused-macro warnings from gcc

* src/ls.c (ASSERT_MATCHING_DEV_INO): Comment-out unused definition,
to match commented-out use.
* src/install.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE):
(READ_SIZE): Remove definitions of unused macros.
* src/mv.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Likewise.
* src/dd.c (max): Likewise.
* src/expand.c (OUTPUT_BLOCK): Likewise.
* src/csplit.c (ALLOC_SIZE): Likewise.
* src/pr.c (NULLCOL): Likewise.
* src/ptx.c (Sword): Likewise.
* src/unexpand.c (OUTPUT_BLOCK): Likewise.
* src/factor.c (NDEBUG): Likewise.
---
 src/csplit.c   |    5 +----
 src/dd.c       |    1 -
 src/expand.c   |    6 +-----
 src/factor.c   |    4 +---
 src/install.c  |    9 ---------
 src/ls.c       |    3 ++-
 src/mv.c       |    6 ------
 src/pr.c       |    2 --
 src/ptx.c      |    5 +----
 src/unexpand.c |    6 +-----
 10 files changed, 7 insertions(+), 40 deletions(-)

diff --git a/src/csplit.c b/src/csplit.c
index b50a650..4f0beb6 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -1,5 +1,5 @@
 /* csplit - split a file into sections determined by context lines
-   Copyright (C) 91, 1995-2008 Free Software Foundation, Inc.
+   Copyright (C) 91, 1995-2009 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -41,9 +41,6 @@
   proper_name ("Stuart Kemp"), \
   proper_name ("David MacKenzie")

-/* Increment size of area for control records. */
-#define ALLOC_SIZE 20
-
 /* The default prefix for output file names. */
 #define DEFAULT_PREFIX "xx"

diff --git a/src/dd.c b/src/dd.c
index e9a5504..9a1c875 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -76,7 +76,6 @@ static void process_signals (void);
 # define fdatasync(fd) (errno = ENOSYS, -1)
 #endif

-#define max(a, b) ((a) > (b) ? (a) : (b))
 #define output_char(c)                         \
   do                                           \
     {                                          \
diff --git a/src/expand.c b/src/expand.c
index 87c8915..10f3643 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -1,5 +1,5 @@
 /* expand - convert tabs to spaces
-   Copyright (C) 89, 91, 1995-2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 89, 91, 1995-2006, 2008-2009 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -47,10 +47,6 @@

 #define AUTHORS proper_name ("David MacKenzie")

-/* The number of bytes added at a time to the amount of memory
-   allocated for the output line.  */
-#define OUTPUT_BLOCK 256
-
 /* If true, convert blanks even after nonblank characters have been
    read on the line.  */
 static bool convert_entire_line;
diff --git a/src/factor.c b/src/factor.c
index 83cd0a8..47273a2 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -1,5 +1,5 @@
 /* factor -- print prime factors of n.
-   Copyright (C) 86, 1995-2005, 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 86, 1995-2005, 2007-2009 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -29,9 +29,7 @@
 #include <gmp.h>
 #endif

-
 #include <assert.h>
-#define NDEBUG 1

 #include "system.h"
 #include "error.h"
diff --git a/src/install.c b/src/install.c
index b09c405..59478a3 100644
--- a/src/install.c
+++ b/src/install.c
@@ -71,15 +71,6 @@ static bool use_default_selinux_context = true;
 # define matchpathcon_init_prefix(a, p) /* empty */
 #endif

-/* Initial number of entries in each hash table entry's table of inodes.  */
-#define INITIAL_HASH_MODULE 100
-
-/* Initial number of entries in the inode hash table.  */
-#define INITIAL_ENTRY_TAB_SIZE 70
-
-/* Number of bytes of a file to copy at a time. */
-#define READ_SIZE (32 * 1024)
-
 static bool change_timestamps (struct stat const *from_sb, char const *to);
 static bool change_attributes (char const *name);
 static bool copy_file (const char *from, const char *to,
diff --git a/src/ls.c b/src/ls.c
index 5d0deec..fa6a59a 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -943,6 +943,7 @@ dev_ino_pop (void)
   return *(struct dev_ino *) obstack_next_free (&dev_ino_obstack);
 }

+/* Note the use commented out below:
 #define ASSERT_MATCHING_DEV_INO(Name, Di)      \
   do                                           \
     {                                          \
@@ -953,7 +954,7 @@ dev_ino_pop (void)
       assert (sb.st_ino == Di.st_ino);         \
     }                                          \
   while (0)
-
+*/

 /* Write to standard output PREFIX, followed by the quoting style and
    a space-separated list of the integers stored in OS all on one line.  */
diff --git a/src/mv.c b/src/mv.c
index 77ad2fb..73bd3ef 100644
--- a/src/mv.c
+++ b/src/mv.c
@@ -41,12 +41,6 @@
   proper_name ("David MacKenzie"), \
   proper_name ("Jim Meyering")

-/* Initial number of entries in each hash table entry's table of inodes.  */
-#define INITIAL_HASH_MODULE 100
-
-/* Initial number of entries in the inode hash table.  */
-#define INITIAL_ENTRY_TAB_SIZE 70
-
 /* For long options that have no equivalent short option, use a
    non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
 enum
diff --git a/src/pr.c b/src/pr.c
index 308a025..0c02430 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -413,8 +413,6 @@ struct COLUMN

 typedef struct COLUMN COLUMN;

-#define NULLCOL (COLUMN *)0
-
 static int char_to_clump (char c);
 static bool read_line (COLUMN *p);
 static bool print_page (void);
diff --git a/src/ptx.c b/src/ptx.c
index c04c90c..5d29bd1 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -1,5 +1,5 @@
 /* Permuted index for GNU, with keywords in their context.
-   Copyright (C) 1990, 1991, 1993, 1998-2008 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1991, 1993, 1998-2009 Free Software Foundation, Inc.
    François Pinard <address@hidden>, 1988.

    This program is free software: you can redistribute it and/or modify
@@ -65,9 +65,6 @@
    the actual reallocation step, but its base two logarithm.  */
 #define SWALLOW_REALLOC_LOG 12

-/* Imported from "regex.c".  */
-#define Sword 1
-
 /* Program options.  */

 enum Format
diff --git a/src/unexpand.c b/src/unexpand.c
index d73d101..9f6a6d7 100644
--- a/src/unexpand.c
+++ b/src/unexpand.c
@@ -1,5 +1,5 @@
 /* unexpand - convert blanks to tabs
-   Copyright (C) 89, 91, 1995-2006, 2008 Free Software Foundation, Inc.
+   Copyright (C) 89, 91, 1995-2006, 2008-2009 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -48,10 +48,6 @@

 #define AUTHORS proper_name ("David MacKenzie")

-/* The number of bytes added at a time to the amount of memory
-   allocated for the output line.  */
-#define OUTPUT_BLOCK 256
-
 /* If true, convert blanks even after nonblank characters have been
    read on the line.  */
 static bool convert_entire_line;
--
1.6.2.rc1.285.gc5f54




reply via email to

[Prev in Thread] Current Thread [Next in Thread]