Subject: Re: bug#7198: ls-misc failure with Oct 10 snapshot

From: Jim Meyering <[email-masked]>
Date: Wed, 13 Oct 2010 09:09:21 +0200

Paul Eggert wrote:
> On 10/12/10 10:57, Jim Meyering wrote:
>
>> What version of RHEL 5.N?  I.e., what's "N"?
>
> /etc/issue says "Red Hat Enterprise Linux Server release 5.5 (Tikanga)".
> uname -a says "Linux lnxsrv01.seas.ucla.edu 2.6.18-194.17.1.el5 #1 SMP Mon Sep 20 07:12:06 EDT 2010 x86_64 GNU/Linux".
>
>> What does perl -v print?
>
> This is perl, v5.8.8 built for x86_64-linux-thread-multi
>
>> I couldn't reproduce that on a 5.5 x86-based system using
>> /usr/bin/gcc. Can you reproduce it with the standard compiler?
>
> Ouch.  Now I can't reproduce the problem with either the standard
> compiler or with my GCC 4.5.1.  However, with the standard compiler
> I get different problems.
>
> test-rand-isaac.c: In function 'main':
> test-rand-isaac.c:599: warning: passing argument 2 of 'strtol' makes pointer fr\
> om integer without a cast
> test-rand-isaac.c:599: warning: passing argument 3 of 'strtol' makes integer fr\
> om pointer without a cast
>
> Something odd is going on here, as that's an obvious typo in the
> test case that GCC 4.5.1 should also have caught.  Dunno why it
> didn't, and don't know why you didn't notice that problem on your
> end, with the standard compiler.

Wow.  That's pretty bad.
Just goes to show (yet again) that we really should be using -Werror also
in gnulib-tests.  But not all maintainers of gnulib's tests have the same
standards/tolerance/expectation for warning levels, so it'll take some work.

I'm about to push this in your name:

>From 9300fffcb54006bf471d96d70cf98081152c6fb1 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Wed, 13 Oct 2010 09:03:41 +0200
Subject: [PATCH] tests: fix rand-isaac test

* gl/tests/test-rand-isaac.c (main): Fix swapped arguments to strtol.
---
 gl/tests/test-rand-isaac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gl/tests/test-rand-isaac.c b/gl/tests/test-rand-isaac.c
index 03b004c..90acb4a 100644
--- a/gl/tests/test-rand-isaac.c
+++ b/gl/tests/test-rand-isaac.c
@@ -594,7 +594,7 @@ main (int argc, char **argv)

   /* If invoked with a positive argument, run a benchmark;
      if with a negative, run a do-nothing benchmark.  */
-  for (iterations = argc <= 1 ? 0 : strtol (argv[1], 10, NULL);
+  for (iterations = argc <= 1 ? 0 : strtol (argv[1], NULL, 10);
        iterations != 0;
        iterations += (iterations < 0 ? 1 : -1))
     if (0 <= iterations)
--
1.7.3.1.104.gc752e