Re: cgit on savannah

2009-03-19 Thread Jim Meyering
Eric Blake wrote:
 http://git.savannah.gnu.org/cgit/zile.git/tree/src/lists.c

 Wow.  That was my first experience with cgit instead of gitweb, and I
 liked it.  When did savannah add cgit, and when did the savannah project
 link to 'browse this project's source' switch over to the cgit URL?  The
 cgit summary page sure loads lots faster than the gitweb summary!

Sylvain Beucler installed it on Savannah more than two months ago.
I like it too, for its cleaner/shorter links,

  http://git.sv.gnu.org/cgit/coreutils.git/plain/HACKING

and for its added +N/-M lines-changed information in the summary.




[PATCH] fsusage: avoid syntax error due to statement-before-declaration

2009-03-19 Thread Jim Meyering
FYI, I've pushed this:

From 22e91b1ffcc74d3cfa0466741dec6f54841e042f Mon Sep 17 00:00:00 2001
From: Jim Meyering meyer...@redhat.com
Date: Thu, 19 Mar 2009 09:15:24 +0100
Subject: [PATCH] fsusage: avoid syntax error due to statement-before-declaration

* lib/fsusage.c (get_fs_usage): Put warning-avoidance statement
after all declarations.  Reported by Matthew Woehlke in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/16231
---
 ChangeLog |7 +++
 lib/fsusage.c |2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 86757f4..29bd643 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-03-19  Jim Meyering  meyer...@redhat.com
+
+   fsusage: avoid syntax error due to statement-before-declaration
+   * lib/fsusage.c (get_fs_usage): Put warning-avoidance statement
+   after all declarations.  Reported by Matthew Woehlke in
+   http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/16231
+
 2009-03-18  Eric Blake  e...@byu.net

build-aux/compile: sync from automake
diff --git a/lib/fsusage.c b/lib/fsusage.c
index ade4195..db0d3bc 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -94,7 +94,6 @@
 int
 get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 {
-  (void) disk;  /* avoid argument-unused warning */
 #if defined STAT_STATVFS   /* POSIX */

   struct statvfs fsd;
@@ -233,6 +232,7 @@ get_fs_usage (char const *file, char const *disk, struct 
fs_usage *fsp)

 #endif

+  (void) disk;  /* avoid argument-unused warning */
   return 0;
 }

--
1.6.2.rc1.285.gc5f54




Re: string.h uses restrict

2009-03-19 Thread Bruno Haible
Eric Blake wrote:
 That is a no-no when using gnulib.  EVERY .c file in your
 project MUST include config.h prior to anything else (or include a
 project-specific .h which in turn includes config.h first).

Yes. This is actually already documented in gnulib's documentation:
  http://www.gnu.org/software/gnulib/manual/html_node/Source-changes.html

Bruno




Re: ls - French translation of N_(%b %e %Y)

2009-03-19 Thread Bruno Haible
Eric Blake wrote:
 The results are unspecified ... or if a minimum field width is
 specified for any conversion specifier other than C , F , G , or Y .

 So I guess the gcc warning is nice if you are being portable to non-GNU
 strftime

And also with GNU strftime, the width feature is useless here: %5b will ensure
that the result occupies 5 _bytes_, not 5 screen columns. POSIX says:
  If the converted value ... has fewer bytes than the minimum field width
   ...  the output shall be padded ...

Bytes and columns are a different thing. For example, in a German UTF-8
locale, Mär is 4 bytes but only 3 screen column. Likewise for fév in
a French UTF-8 locale.

Test program:
=
#include stdio.h
#include locale.h
#include time.h
int main()
{
  setlocale (LC_ALL, );
  char buf[100];
  time_t now = time (NULL);
  strftime (buf, 100, %5b, localtime (now));
  printf (|%s|\n, buf);
  return 0;
}
=

$ LC_ALL=fr_FR.UTF-8 ./a.out 
| mars|
$ LC_ALL=de_DE.UTF-8 ./a.out 
| Mär|

You can see that for column alignment purposes, it is useless.

Bruno




close vs socket vs getline

2009-03-19 Thread Simon Josefsson
This may have been discussed before, but I don't recall a solution, so
maybe a new report will help.

Gsasl and gnutls uses the close, socket and getline modules from gnulib.
I get a problem when building gnulib's self-tests for mingw.  You can
reproduce it by using:

rm -rf m
gnulib-tool --create-testdir --with-tests --dir m close getdelim socket
cd m
./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu
make check

The error is:

i586-mingw32msvc-gcc  -g -O2   -o test-getdelim.exe test-getdelim.o 
../gllib/libgnu.a 
../gllib/libgnu.a(close.o): In function `_gl_close_fd_maybe_socket':
/home/jas/src/gnulib/m/gllib/close.c:39: undefined reference to 
`_wsaenumnetworkeve...@12'
/home/jas/src/gnulib/m/gllib/close.c:46: undefined reference to `_closesoc...@4'
../gllib/libgnu.a(close.o): In function `set_winsock_errno':
/home/jas/src/gnulib/m/gllib/w32sock.h:34: undefined reference to 
`_wsagetlaster...@0'
/home/jas/src/gnulib/m/gllib/w32sock.h:35: undefined reference to 
`_wsasetlaster...@4'

What appears to be missing is that -lws2_32 is added to the linker line.
If I link the test-getdelim.exe program with -lws2_32 and re-run make
check, everything works fine.

Some ideas:

1) Should the sockets.m4 module unconditionally add LIBSOCKET to LDADD?

2) Should the gnulib-tool generated Makefile.am add LIBSOCKET to LDADD?

Is there any other options?

Thanks,
/Simon




Re: another round of cygwin updates

2009-03-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 3/17/2009 6:00 AM:
 Cygwin 1.7.0 will be adding even more wide character functions.

And fixed a bug where log2{,f} was only a macro, rather than an exported
function.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknCNx8ACgkQ84KuGfSFAYBnmACfTK6QE4MFv/f3QarX+2Lo5Kns
cIAAoLzFcFH3KScji7gDQxZtRKIv4IBs
=okfY
-END PGP SIGNATURE-
From 900bba46b69ab042515b246c4bb6e05614e2461c Mon Sep 17 00:00:00 2001
From: Eric Blake e...@byu.net
Date: Thu, 19 Mar 2009 06:11:36 -0600
Subject: [PATCH] doc: mention more functions added in cygwin 1.7.0

* doc/posix-functions/log2.texi: Mention recent cygwin 1.7.0
addition.
* doc/posix-functions/log2f.texi: Likewise.

Signed-off-by: Eric Blake e...@byu.net
---
 ChangeLog  |7 +++
 doc/posix-functions/log2.texi  |6 +-
 doc/posix-functions/log2f.texi |6 +-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 86757f4..db2435a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-03-19  Eric Blake  e...@byu.net
+
+   doc: mention more functions added in cygwin 1.7.0
+   * doc/posix-functions/log2.texi: Mention recent cygwin 1.7.0
+   addition.
+   * doc/posix-functions/log2f.texi: Likewise.
+
 2009-03-18  Eric Blake  e...@byu.net

build-aux/compile: sync from automake
diff --git a/doc/posix-functions/log2.texi b/doc/posix-functions/log2.texi
index f347358..f0676c6 100644
--- a/doc/posix-functions/log2.texi
+++ b/doc/posix-functions/log2.texi
@@ -14,5 +14,9 @@ Portability problems not fixed by Gnulib:
 @itemize
 @item
 This function is missing on some platforms:
-MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, IRIX 6.5, Solaris 
9, Cygwin, Interix 3.5.
+MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, IRIX 6.5,
+Solaris 9, Interix 3.5.
+...@item
+This function is only provided as a macro on some platforms:
+Cygwin 1.5.x.
 @end itemize
diff --git a/doc/posix-functions/log2f.texi b/doc/posix-functions/log2f.texi
index 33670ff..4583a17 100644
--- a/doc/posix-functions/log2f.texi
+++ b/doc/posix-functions/log2f.texi
@@ -14,5 +14,9 @@ Portability problems not fixed by Gnulib:
 @itemize
 @item
 This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, IRIX 6.5, Solaris 9, Cygwin, 
Interix 3.5.
+FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, IRIX 6.5, Solaris 9,
+Interix 3.5.
+...@item
+This function is only provided as a macro on some platforms:
+Cygwin 1.5.x.
 @end itemize
-- 
1.6.1.2



Re: ls - French translation of N_(%b %e %Y)

2009-03-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Bruno Haible on 3/19/2009 5:45 AM:
 Eric Blake wrote:
 The results are unspecified ... or if a minimum field width is
 specified for any conversion specifier other than C , F , G , or Y .

 So I guess the gcc warning is nice if you are being portable to non-GNU
 strftime
 
 And also with GNU strftime, the width feature is useless here: %5b will ensure
 that the result occupies 5 _bytes_, not 5 screen columns. POSIX says:
   If the converted value ... has fewer bytes than the minimum field width
...  the output shall be padded ...

But that's my point - POSIX _only_ specifies bytes for the four
numeric-only fields C, F, G, and Y, where byte and screen width are
identical (regardless of your locale, numbers should always be one byte
per column).  It specifically states that results are unspecified for
other things, like %b, where there could be more bytes than screen
columns.  Which means we should be free to interpret things in the way
that makes the most sense, by interpreting %5b as five screen columns
rather than 5 bytes.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknCMuMACgkQ84KuGfSFAYCukQCgp4UCMLPIUqFGCBVNSMFPzu7Y
I94AoI+uVG9PADvVvihS8RaCRtO+1ej/
=4H0m
-END PGP SIGNATURE-




Re: string.h uses restrict

2009-03-19 Thread Jim Meyering
Reuben Thomas wrote:
 On Wed, 18 Mar 2009, Eric Blake wrote:

 Ahh.  The bug is in zile, not gnulib.

 Ah, thanks very much, and apologies for the noise.

Always including config.h first is easy to forget.
You might want to use rules like these from gnulib's maint.mk:

# Nearly all .c files must include config.h.
sc_require_config_h:
@if $(VC_LIST_EXCEPT) | grep '\.c$$'  /dev/null; then  \
  grep -L '^# *include config\.h' \
$$($(VC_LIST_EXCEPT) | grep '\.c$$')\
  | grep .\
  { echo '$(ME): the above files do not include config.h' \
12; exit 1; } || :;   \
else :; \
fi

# You must include config.h before including any other header file.
sc_require_config_h_first:
@if $(VC_LIST_EXCEPT) | grep '\.c$$'  /dev/null; then  \
  fail=0;   \
  for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
grep '^# *include\' $$i | sed 1q   \
| grep '^# *include config\.h'  /dev/null\
  || { echo $$i; fail=1; }; \
  done; \
  test $$fail = 1 \
{ echo '$(ME): the above files include some other header'   \
'before config.h' 12; exit 1; } || :;   \
else :; \
fi




Re: [Translation-team-de] German translations for man-db and gnulib

2009-03-19 Thread Sergey Poznyakoff
Colin Watson cjwat...@debian.org ha escrit:

 Indeed, http://translationproject.org/POT-files/gnulib-1.1.pot is
 looking a bit stale. Could somebody on bug-gnulib update the POT file
 held by the TP, please?

That's my fault. I'll update it today.

Regards,
Sergey




Re: ls - French translation of N_(%b %e %Y)

2009-03-19 Thread Bruno Haible
Eric Blake wrote:
 It specifically states that results are unspecified for
 other things, like %b, where there could be more bytes than screen
 columns.  Which means we should be free to interpret things in the way
 that makes the most sense, by interpreting %5b as five screen columns
 rather than 5 bytes.

I wish you could convince the glibc maintainers to implement strftime
this way. But I don't give it much chances, because it would be a change
away from current glibc behaviour, and current glibc behaviour coincides
with the POSIX wording (bytes).

Bruno




ls -v is still inconsistent

2009-03-19 Thread Sven Joachim
While the ordering of hidden files in ls -v seems to be fixed
now, there are still inconsistencies.  Here's what I get in the latest
snapshot:

,
| LANG=C /usr/local/src/coreutils-7.1.63-8e6a6/src/ls -alv
| total 0
| drwxr-xr-x 2 sven sven 160 Mar 19 11:13 .
| drwxrwxrwt 9 root root 200 Mar 19 11:15 ..
| -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a~
| -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a
| -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.b
| -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.bc
| -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.b~
| -rw-r--r-- 1 sven sven   0 Mar 19 11:13 a.bc~
`

Note that a~ sorts before a, but a.b~ after a.b.

Regards,
Sven