bug-gnulib
[Top][All Lists]
Advanced

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

Re: quotearg improvements


From: Jim Meyering
Subject: Re: quotearg improvements
Date: Wed, 13 Feb 2008 12:00:07 +0100

Eric Blake <address@hidden> wrote:
> I'm committing these three patches as is, plus a fourth.  This patch adds
...

Hi Eric,

Thanks for doing that.
I noticed that something about these changes causes
trouble with coreutils builds (albeit merely because it
runs the new test-quotearg program from gnulib):

  http://buildbot.proulx.com:9000

e.g.,

  http://buildbot.proulx.com:9000/i686%20gnu-linux/builds/2732/step-test/0


  ../../gnulib-tests/test-quotearg.c:217: error: expected declaration 
specifiers or '...' before '(' token
../../gnulib-tests/test-quotearg.c:217: error: expected declaration specifiers 
or '...' before '__LC_MESSAGES'
../../gnulib-tests/test-quotearg.c:218: error: conflicting types for 'dcgettext'
../../gnulib-tests/test-quotearg.c:232: error: expected declaration specifiers 
or '...' before '__LC_MESSAGES'
../../gnulib-tests/test-quotearg.c:233: error: conflicting types for 'dcgettext'
../../gnulib-tests/test-quotearg.c: In function 'dcgettext':
../../gnulib-tests/test-quotearg.c:234: error: too many arguments to
function 'dcgettext'

I used the following patch to fix those and a couple other warnings,
but even with that, when the test actually runs, it gets a failed
assertion.  I'll look into that later.

>From 476c010989da215c93522dd75e73ad3e9b0205da Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 13 Feb 2008 11:56:59 +0100
Subject: [PATCH] avoid shadowing warning and compile errors

Signed-off-by: Jim Meyering <address@hidden>
---
 tests/test-quotearg.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/test-quotearg.c b/tests/test-quotearg.c
index 86ffd7c..2689e86 100644
--- a/tests/test-quotearg.c
+++ b/tests/test-quotearg.c
@@ -66,7 +66,7 @@ static struct result_strings inputs = {
   "", "\0001\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b"
 };

-static struct result_groups results[] = {
+static struct result_groups result_g[] = {
   /* literal_quoting_style */
   { { "", "\0""1\0", 3, "simple", " \t\n'\"\033?""?/\\", "a:b" },
     { "", "1", 1, "simple", " \t\n'\"\033?""?/\\", "a:b" },
@@ -208,6 +208,8 @@ use_quotearg_colon (const char *str, size_t *len)
 #if ENABLE_NLS
 /* True if the locale should be faked.  */
 static bool fake_locale;
+#undef gettext
+#define dgettext(a,b) tq_dgettext(a,b)

 /* A replacement gettext that allows testing of locale quotes without
    requiring a locale.  */
@@ -234,7 +236,7 @@ dgettext (char const *d, char const *str)
 #endif /* ENABLE_NLS */

 int
-main (int argc, char **argv)
+main ()
 {
   int i;

@@ -244,9 +246,9 @@ main (int argc, char **argv)
   for (i = literal_quoting_style; i <= clocale_quoting_style; i++)
     {
       set_quoting_style (NULL, i);
-      compare_strings (use_quotearg_buffer, &results[i].group1);
-      compare_strings (use_quotearg, &results[i].group2);
-      compare_strings (use_quotearg_colon, &results[i].group3);
+      compare_strings (use_quotearg_buffer, &result_g[i].group1);
+      compare_strings (use_quotearg, &result_g[i].group2);
+      compare_strings (use_quotearg_colon, &result_g[i].group3);
     }

 #if ENABLE_NLS
--
1.5.4.1.35.g882c




reply via email to

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