Re: [PATCH] di-set, ino-map: new modules, from coreutils

2011-02-08 Thread Jim Meyering
Bruno Haible wrote: > Jim Meyering wrote: >> * lib/di-set.c: New file. >> * lib/di-set.h: Likewise. >> * modules/di-set: Likewise. >> * modules/di-set-tests: Likewise. >> * tests/test-di-set.c: Likewise. > > A copyright header would make sense in lib/di-set.h. > > In lib/di-set.c, function di_ent_

Re: [PATCH] di-set, ino-map: new modules, from coreutils

2011-02-08 Thread Bruno Haible
Jim Meyering wrote: > > dev_t is an integral type. ... It could also be a floating-point type. > > As Paul said, I think we can be confident that this > is not a problem in practice. Yes, I agree. While defining time_t to a floating-point type would have been understandable, for dev_t it would be

Re: struct random_data in

2011-02-08 Thread Bruno Haible
Hi Paul, > The stdlib patch removes an unnecessary dependency on stdint. OK. The idea behind defining 'struct random_data' in also when the 'random_r' module is not requested is that glibc has this type in , hence so should gnulib. But I can agree that having it defined only together with the '

[PATCH] di-set.h, ino-map.h: add multiple-inclusion guard

2011-02-08 Thread Jim Meyering
I've added #ifndef guards: >From d9f5da66f7c95f84b6b28b17cfa4c5248ad2b591 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 8 Feb 2011 11:54:05 +0100 Subject: [PATCH] di-set.h, ino-map.h: add multiple-inclusion guard Technically, the guard is required only for ino-map.h, due to its INO_MAP_

Re: struct random_data in

2011-02-08 Thread Bruno Haible
Hi Paul, I wrote: > I would prefer this patch instead: > > --- lib/stdlib.in.h.orig Tue Feb 8 11:50:31 2011 > +++ lib/stdlib.in.h Tue Feb 8 11:50:19 2011 > @@ -50,17 +50,17 @@ > #endif > > /* OSF/1 5.1 declares 'struct random_data' in , which is included > - from if _REENTRANT is

Re: [PATCH] di-set, ino-map: new modules, from coreutils

2011-02-08 Thread Eric Blake
On 02/07/2011 10:29 PM, Paul Eggert wrote: > On 02/07/2011 04:45 PM, Bruno Haible wrote: >> In lib/di-set.c, function di_ent_hash, there is the assumption that >> dev_t is an integral type. But POSIX >> >> does not guarante

Re: [PATCH] di-set.h, ino-map.h: add multiple-inclusion guard

2011-02-08 Thread Paul Eggert
On 02/08/2011 02:54 AM, Jim Meyering wrote: > Technically, the guard is required only for ino-map.h, due to its > INO_MAP_INSERT_FAILURE definition Sorry, I don't understand this point. In C, it's OK to #define the same macro twice, as long as the two definitions are identical. Did some compiler

Re: [PATCH] di-set.h, ino-map.h: add multiple-inclusion guard

2011-02-08 Thread Jim Meyering
Paul Eggert wrote: > On 02/08/2011 02:54 AM, Jim Meyering wrote: >> Technically, the guard is required only for ino-map.h, due to its >> INO_MAP_INSERT_FAILURE definition > > Sorry, I don't understand this point. In C, it's OK to > #define the same macro twice, as long as the > two definitions are

Re: struct random_data in

2011-02-08 Thread Paul Eggert
On 02/08/11 03:13, Bruno Haible wrote: > When you have done this, you can also move the test for random.h from > stdlib_h.m4 to random_r.m4: Thanks for the careful review and the suggestion. I did all that, pushing the patches previously circulated, along with this additional patch based on that

INT_STRLEN_BOUND and locales with *printf

2011-02-08 Thread Ben Pfaff
The INT_STRLEN_BOUND macro in Gnulib's intprops.h calculates the maximum number of bytes in a formatted integer, on the basis that the minus sign and each digit will occupy one byte. If *printf is used for formatting integers, is this a good assumption outside of the C locale? I do not see anythi

Re: [PATCH] di-set.h, ino-map.h: add multiple-inclusion guard

2011-02-08 Thread Paul Eggert
On 02/08/11 08:52, Jim Meyering wrote: > I can revert it, then. Or leave it... > Do you have a preference? I'd leave it alone, not only on the general principle of laziness, but also because (unless they've ripped out the code I contributed many years ago) GCC optimizes away "#include " if foo.h'

Re: INT_STRLEN_BOUND and locales with *printf

2011-02-08 Thread Eric Blake
On 02/08/2011 01:34 PM, Ben Pfaff wrote: > The INT_STRLEN_BOUND macro in Gnulib's intprops.h calculates the > maximum number of bytes in a formatted integer, on the basis that > the minus sign and each digit will occupy one byte. If *printf > is used for formatting integers, is this a good assumpt

Re: INT_STRLEN_BOUND and locales with *printf

2011-02-08 Thread Paul Eggert
On 02/08/11 12:34, Ben Pfaff wrote: > The INT_STRLEN_BOUND macro in Gnulib's intprops.h calculates the > maximum number of bytes in a formatted integer, on the basis that > the minus sign and each digit will occupy one byte. If *printf > is used for formatting integers, is this a good assumption >

HP-UX sed limited to 100 commands problematic for modules/wchar

2011-02-08 Thread Albert Chin
The HP-UX sed command is limited to 100 commands. From sed(1) on HP-UX 11.31: DESCRIPTION sed copies the named text files (standard input default) to the standard output, edited according to a script containing up to 100 commands. Only complete input lines are processed. Any in

Re: HP-UX sed limited to 100 commands problematic for modules/wchar

2011-02-08 Thread Ralf Wildenhues
Hello Albert, * Albert Chin wrote on Tue, Feb 08, 2011 at 08:45:13PM CET: > wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) > $(AM_V_GEN)rm -f $@-t $@ && \ > { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ > 27: sed -e 's|@''INCLUDE_NEXT''@|$(INCL

Re: HP-UX sed limited to 100 commands problematic for modules/wchar

2011-02-08 Thread Eric Blake
On 02/08/2011 12:45 PM, Albert Chin wrote: > wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) > $(AM_V_GEN)rm -f $@-t $@ && \ > { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ > 27: sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ > -

Re: INT_STRLEN_BOUND and locales with *printf

2011-02-08 Thread Ben Pfaff
Paul Eggert writes: > On 02/08/11 12:34, Ben Pfaff wrote: >> The INT_STRLEN_BOUND macro in Gnulib's intprops.h calculates the >> maximum number of bytes in a formatted integer, on the basis that >> the minus sign and each digit will occupy one byte. If *printf >> is used for formatting integers,

Re: INT_STRLEN_BOUND and locales with *printf

2011-02-08 Thread Paul Eggert
On 02/08/11 12:52, Ben Pfaff wrote: > Thanks. I was assuming a plain format such as %d. > > Does your answer come from experience with many implementations, > or is it based on knowledge of some document or standard? Both. The relevant standard

Re: INT_STRLEN_BOUND and locales with *printf

2011-02-08 Thread Eric Blake
On 02/08/2011 01:52 PM, Ben Pfaff wrote: > Paul Eggert writes: > >> On 02/08/11 12:34, Ben Pfaff wrote: >>> The INT_STRLEN_BOUND macro in Gnulib's intprops.h calculates the >>> maximum number of bytes in a formatted integer, on the basis that >>> the minus sign and each digit will occupy one byte

Re: INT_STRLEN_BOUND and locales with *printf

2011-02-08 Thread Ben Pfaff
Thank you very much for these detailed explanations. -- Ben Pfaff http://benpfaff.org

Re: [PATCH] di-set.h, ino-map.h: add multiple-inclusion guard

2011-02-08 Thread Bruno Haible
> > I can revert it, then. Or leave it... > > Do you have a preference? > > I'd leave it alone I'd also leave it alone, for two other reasons: - Some typedef or struct definition may be added to the file in the future. - Some people use the gcc option "-Wredundant-decls". It produces a war

Re: HP-UX sed limited to 100 commands problematic for modules/wchar

2011-02-08 Thread Bruno Haible
Eric Blake wrote: > the correct fix is to break this into > multiple sed scripts (we've already done it for other large headers, > such as unistd). Yes, that's the correct fix. On 2010-01-16 Ralf suggested to break up the sed commands after 50 substitutions, in order to keep away from the limit o

Re: Confusing license statements in some Gnulib imports

2011-02-08 Thread Paul Eggert
On 02/08/2011 04:33 PM, Glenn Morris wrote: > In the Emacs trunk, eg arg-nonnull.h says: > >This program is free software: you can redistribute it and/or modify it >under the terms of the GNU General Public License as published > ^^ >b