bug-findutils
[Top][All Lists]
Advanced

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

[PATCH 3/3] Fix syntax checks problems for check sc_unmarked_diagnostics


From: James Youngman
Subject: [PATCH 3/3] Fix syntax checks problems for check sc_unmarked_diagnostics.
Date: Sun, 11 Apr 2010 11:35:03 +0100

* find/tree.c (get_pred_cost): Clarify an error message and mark
it for translation.

Signed-off-by: James Youngman <address@hidden>
---
 ChangeLog   |    4 ++++
 find/tree.c |   13 +++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ea047ce..97e4814 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-11  James Youngman  <address@hidden>
 
+       Fix syntax checks problems for check sc_unmarked_diagnostics.
+       * find/tree.c (get_pred_cost): Clarify an error message and mark
+       it for translation.
+
        Fix false positives for syntax check sc_prohibit_test_minus_ao.
        * .x-sc_prohibit_test_minus_ao: Add all the DejaGnu scripts to the
        list of exceptions to the 'test C1 -a C2' syntax check, since they
diff --git a/find/tree.c b/find/tree.c
index 4417b4c..7f418b6 100644
--- a/find/tree.c
+++ b/find/tree.c
@@ -1100,7 +1100,7 @@ get_pred_cost (const struct predicate *p)
                             cost_table_comparison))
            {
              error (EXIT_FAILURE, 0,
-                    "Failed to sort the costlookup array (indirect).");
+                    "failed to sort the costlookup array");
            }
          pred_table_sorted = 1;
        }
@@ -1115,7 +1115,16 @@ get_pred_cost (const struct predicate *p)
        }
       else
        {
-         error(0, 0, "warning: no cost entry for predicate %s", p->p_name);
+         /* This message indicates a bug.  If we issue the message, we
+            actually have two bugs: if find emits a diagnostic, its result
+            should be nonzero.  However, not having an entry for a predicate
+            will not affect the output (just the performance) so I think it
+            would be confusing to exit with a nonzero status.
+         */
+         error (0, 0,
+                _("warning: there is no entry in the predicate evaluation "
+                  "cost table for predicate %s; please report this as a bug"),
+                p->p_name);
          inherent_cost = NeedsUnknown;
        }
     }
-- 
1.7.0





reply via email to

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