Bruno Haible | 1 May 2009 02:22

Re: Request: srand48/ drand48

Hello Stefan,

> I assume everybody still remembers the drand48 issue ;-)

Yes: it resurfaces repeatedly :-)

> I just had the time to dive into Richards code and the comments on it. 
> Would'nt it be easier to fetch the whole thing from glibc again? Instead 
> of pulling Richards code apart and placing everything back where it came 
> from?

If it appears to be more effective to you to go that way, why should we
object? You evaluated Richard's earlier proposed code. It's your decision
to start from it, or start from scratch.

> Or is it recommended to write stuff for gnulib frm scratch?

We try to reuse code from glibc where possible, because
  - it allows us to provide the desired modules with minimum effort,
  - this code is well tested,
  - it helps glibc if we find bugs in glibc code.

Every now and then, a bidirectional sync happens, to merge modifications
from glibc into gnulib, and to propose changes done in gnulib for inclusion
in glibc. In order to ease these merges, we try to do the porting in a way
that minimizes the effect on the source code. For example, instead of
replacing '__open' with 'open' everywhere, we put
  #if !_LIBC
  # define __open open
  #endif
(Continue reading)

David Bartley | 1 May 2009 08:59
Picon
Picon
Favicon

Re: [PATCH] New sol10priv module

On Wed, Apr 29, 2009 at 1:57 AM, Jim Meyering <jim <at> meyering.net> wrote:
> David Bartley wrote:
>> The following patches for coreutils and gnulib add a new Solaris 10
>> privilege module as previously suggested [1].
>
> Hi David,
>
> Thanks for following through.
> Are you up to the task of making a few more changes?
>

Thanks for suggestions. I've attached updated patches that hopefully
address your and Bruno's concerns.

I successfully ran make check on Linux. On Solaris, I fail 5 test
cases regardless of whether the patch is applied or not.

-- David
Jim Meyering | 1 May 2009 09:59
Gravatar

Re: [PATCH] getdate add a week when the wday is the same as the current one

Giuseppe Scrivano wrote:
> what do you think of the following patch?  When the same day as the
> current one is provided then a week is added.  It doesn't change the
> behaviour for days in the past.
>
> It closes coreutils #25406.
>
> diff --git a/lib/getdate.y b/lib/getdate.y
> index 877b264..8154fd9 100644
> --- a/lib/getdate.y
> +++ b/lib/getdate.y
>  <at>  <at>  -1435,7 +1435,7  <at>  <at>  get_date (struct timespec *result, char const *p, struct timespec const *now)
>        if (pc.days_seen && ! pc.dates_seen)
>         {
>           tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
> -                        + 7 * (pc.day_ordinal - (0 < pc.day_ordinal)));
> +                   + 7 * (pc.day_ordinal + (pc.day_ordinal > 0 && tm.tm_wday == pc.day_number) - (0 < pc.day_ordinal)));
>           tm.tm_isdst = -1;
>           Start = mktime (&tm);
>           if (Start == (time_t) -1)

Nice!
It certainly fixes the bug:

    Today is Friday, May 1:

        $ ./date +%a.%F
        Fri.2009-05-01

    Before, "next friday" would give today's date:
(Continue reading)

Pádraig Brady | 1 May 2009 10:57

Re: [PATCH] getdate add a week when the wday is the same as the current one

Jim Meyering wrote:
> I expect to push this shortly.
> Thank you!

>>From 372c3b4a79def664b8fa73316c35caf39bf93e2c Mon Sep 17 00:00:00 2001
> From: Giuseppe Scrivano <gscrivano <at> gnu.org>
> Date: Fri, 1 May 2009 09:23:20 +0200
> Subject: [PATCH] getdate: correctly interpret "next monday" when run on a Monday
> 
> * lib/getdate.y (get_date): Correct the calculation of tm_mday so
> that e.g., "next tues" (when run on a tuesday) results in a date
> that is one week in the future, and not today's date.
> Reported by Tom Broadhurst http://savannah.gnu.org/bugs/?25406
> and earlier by Martin Bernreuther.

And Jan Minář (CCd):
http://lists.gnu.org/archive/html/bug-coreutils/2008-12/threads.html#00064
Nice to see this finally fixed.

cheers,
Pádraig.

Ralf Wildenhues | 1 May 2009 11:17
Picon
Picon

Re: [Patch] faster fnmatch

Hello Ondrej,

* Ondrej Bilka wrote on Thu, Apr 30, 2009 at 10:41:49PM CEST:
> I here attach compiled fnmatch I wrote as gnulib module. 

I haven't read your patch closely, but it fails to check the return
value from all of the malloc/realloc... functions, opening up several
opportunities for segmentation violations.

Since this is a library module, fnmatch should instead fail gracefully
and report the failure to its caller.

Cheers,
Ralf

Bruno Haible | 1 May 2009 13:03

Re: [PATCH] getdate add a week when the wday is the same as the current one

Jim Meyering wrote:
>  	  tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
> +			 + 7 * (pc.day_ordinal
> +				+ (0 < pc.day_ordinal
> +				   && tm.tm_wday == pc.day_number)
> +				- (0 < pc.day_ordinal)));

This can be simplified to

  	  tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
			 + 7 * (pc.day_ordinal
				- (0 < pc.day_ordinal
				   && tm.tm_wday != pc.day_number)));

Bruno

Giuseppe Scrivano | 1 May 2009 13:32
Picon
Gravatar

Re: [PATCH] getdate add a week when the wday is the same as the current one

Hello,

This patch includes all your suggestions and new tests for
test-getdate.c.

Giuseppe

Bruno Haible <bruno <at> clisp.org> writes:

> Jim Meyering wrote:
>>  	  tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
>> +			 + 7 * (pc.day_ordinal
>> +				+ (0 < pc.day_ordinal
>> +				   && tm.tm_wday == pc.day_number)
>> +				- (0 < pc.day_ordinal)));
>
> This can be simplified to
>
>   	  tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
> 			 + 7 * (pc.day_ordinal
> 				- (0 < pc.day_ordinal
> 				   && tm.tm_wday != pc.day_number)));
>
> Bruno
Attachment (getdate.diff): text/x-diff, 2536 bytes
Bruno Haible | 1 May 2009 13:35

Re: [PATCH] New sol10priv module

David Bartley wrote:
> I've attached updated patches that hopefully
> address your and Bruno's concerns.

Looks quite fine. Only a couple of minor points:

  - m4/priv-set.m4 should do an AC_REQUIRE([AC_C_INLINE])
    because the .h file uses 'static inline'.

  - In priv-set.c, maybe add comments about
      - what eff_set contains,
      - what rem_set contains,
      - why we expect that priv_addset will not fail.
    These points are not immediately clear when reading the code.

  - An indentation problem in priv-set.c:39.

Jim, I leave it to you to commit this for David, since I don't want to
interfere with your coreutils release.

Bruno

Eric Blake | 1 May 2009 14:34
Gravatar

Re: Compiler error of m4-1.4.13 on AIX using xlc


[adding bug-gnulib]

According to Jens Rehsack on 5/1/2009 5:32 AM:
> Hi Eric,

Hi Jens,

> 
> Thomas told me, you're the best person to ask for assistance regarding the
> problem below.

Well, actually 'm4 --help' (or even './configure --help', since you didn't
get to the point of a built m4 yet) would have told you that
bug-m4 <at> gnu.org was the right list, without having to also ask Thomas, but
I'm glad you found the right place.

> 
> I tried to do the update to m4-1.4.13 (using PkgSrc) on AIX and got
> following error:
> 
>>  CC  regex.o
>> "regex_internal.c", line 320.48: 1506-280 (W) Function argument assignment 
>> between types "char** restrict" and "int*" is not allowed.
>> "regex_internal.c", line 388.55: 1506-280 (W) Function argument assignment 
>> between types "char** restrict" and "int*" is not allowed.
>> "regcomp.c", line 339.63: 1506-280 (W) Function argument assignment 
>> between types "char** restrict" and "int*" is not allowed.
>> "regcomp.c", line 411.57: 1506-280 (W) Function argument assignment 
>> between types "char** restrict" and "int*" is not allowed.
(Continue reading)

Jim Meyering | 1 May 2009 14:38
Gravatar

Re: [PATCH] getdate add a week when the wday is the same as the current one

Giuseppe Scrivano wrote:
> This patch includes all your suggestions and new tests for
> test-getdate.c.

Thanks for the quick test addition!
I want the summary line to start with "getdate: "
and do be "high-level descriptive" so I moved your
"add a week..." sentence into the body of the log.
Also, I kept the TAB-oriented indentation and made
Bruno's simplification (Thanks, Bruno!).

Regarding the test, I added a "const" and tweaked formatting
so the continued expression starts with "&&" rather than
leaving the operator at the end of the preceding line.
That is the prevailing and recommended style.

However, there is a problem.
With this change, today (a Friday), ./date -d fri
prints the date for a week from today.
Without the patch, it prints today's date.
That is a regression, and shows that we'll need
several more tests.

If you make further changes, please use the following
as a basis, so I don't have to change your spaces to TABs
again or to adjust the content or formatting of the commit log.

From 664db25a03246f510793d74fce674b68f32d1dc3 Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <gscrivano <at> gnu.org>
Date: Fri, 1 May 2009 09:23:20 +0200
(Continue reading)


Gmane