Re: Possible spurious cycle detection with fts
James Youngman [EMAIL PROTECTED] wrote: This patch resolves my problem; thanks. Might I suggest though that you enhance the ChangeLog entry to describe the problem as well as the solution? This change requires some comment changes, too. I'll do both. ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib
Re: error: possibly undefined macro: AC_CHECK_HEADERS_ONCE
Hello, On Sun, Aug 07, 2005 at 01:21:04PM -0400, Sam Steingold wrote: Maybe this trick is not working reliably; aclocal was not designed for this... Could you post the ad hoc created configure.in? so it seems the problem is in regex.m4, which comes from gnulib. Thus I cc this post to bug-gnulib. The macro gl_INCLUDED_REGEX contains this: m4_syscmd([test -f '$1']) ifelse(m4_sysval, 0, [ ... gl_PREREQ_REGEX ]) Macro gl_PREREQ_REGEX, which calls AC_CHECK_HEADERS_ONCE, is expanded only if the current directory contains the file regex.c (the argument to gl_INCLUDED_REGEX). For Sam: so the magic workaround should be to touch the file regex.c in the same directory where you have your artificial configure.in. For gnulib people: Why is the above trick necessary? Why should the macro expansion depend on the presence of the file? Second: just above the quoted code: test -n $1 || AC_MSG_ERROR([missing argument]) yes, the macro gl_INCLUDED_REGEX requires a parameter, but why it should be reported in runtime? (Yes, the parameter might be a shell variable, but is this done often?) Third, the name regex.m4 conflicts with a file in Automake. This can cause problems with aclocal --include. Could we perhaps rename it? Fourth, I noticed a typo; could you please apply the attached patch? Fifth: when my minmax patch is resolved (Bruno ;-), shouldn't something similar go to onceonly*.m4, too? Have a nice day, Stepan Kasal 2005-08-10 Stepan Kasal [EMAIL PROTECTED] * onceonly_2_57.m4: Really require Autoconf 2.57. Index: m4/onceonly_2_57.m4 === RCS file: /cvsroot/gnulib/gnulib/m4/onceonly_2_57.m4,v retrieving revision 1.5 diff -u -r1.5 onceonly_2_57.m4 --- m4/onceonly_2_57.m4 18 Mar 2003 10:08:34 - 1.5 +++ m4/onceonly_2_57.m4 10 Aug 2005 09:02:40 - @@ -1,5 +1,5 @@ -# onceonly_2_57.m4 serial 3 -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +# onceonly_2_57.m4 serial 4 +dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -27,7 +27,7 @@ dnl size reduction is ca. 9%. dnl Autoconf version 2.57 or newer is recommended. -AC_PREREQ(2.54) +AC_PREREQ(2.57) # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of # AC_CHECK_HEADERS(HEADER1 HEADER2 ...). ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib
test-iconvme
I installed this, a simple test tool for iconvme. 2005-08-10 Simon Josefsson [EMAIL PROTECTED] * tests/test-iconvme.c: New file. Index: tests/test-iconvme.c === RCS file: tests/test-iconvme.c diff -N tests/test-iconvme.c --- /dev/null 1 Jan 1970 00:00:00 - +++ tests/test-iconvme.c10 Aug 2005 10:38:16 - @@ -0,0 +1,84 @@ +/* Recode strings between character sets, using iconv. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include stdlib.h +#include stdio.h + +#include iconvme.h + +int main (int ac, char *av[]) +{ + char *in = NULL, *out = NULL; + char *to = NULL, *from = NULL; + + if (ac 1) +from = av[1]; + + if (ac 2) +to = av[2]; + + if (ac 3) +in = av[3]; + + if (!in) +{ + size_t len = 0; + printf (Enter string to convert:\n\t ); + if (getline (in, len, stdin) 0) + perror (getline); + if (in[strlen (in) - 1] == '\n') + in[strlen (in) - 1] = '\0'; +} + + if (!to) +{ + size_t len = 0; + printf (Enter destination code set:\n\t ); + if (getline (to, len, stdin) 0) + perror (getline); + if (to[strlen (to) - 1] == '\n') + to[strlen (to) - 1] = '\0'; +} + + if (!from) +{ + size_t len = 0; + printf (Enter source code set:\n\t ); + if (getline (from, len, stdin) 0) + perror (getline); + if (from[strlen (from) - 1] == '\n') + from[strlen (from) - 1] = '\0'; +} + + printf ( Input string: `%s'\n + From code set: `%s'\n + To code set: `%s'\n, + in, from, to); + + out = iconv_string (in, from, to); + + if (out == NULL) +perror (iconv); + else +{ + printf (\nOutput: `%s'\n, out); + free (out); +} + + return EXIT_SUCCESS; +} ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib
Re: strnlen.h needed?
(Old thread; I want to clean up my gnulib CVS tree...) Simon Josefsson [EMAIL PROTECTED] writes: Dave Love [EMAIL PROTECTED] writes: It looks as if gnulib needs a strnlen.h which declares rpl_strnlen appropriately (conditional on HAVE_STRNLEN) and it should be used in files where strnlen is called. I agree. Here's a patch for gnulib. Untested, but based on snprintf.h. Ok to install? strnlen is a GNU extension, according to libc manual. There were some discussion regarding strnlen.h, but the patch below has worked for me for a while. Any problems can be fixed later on. It seems correct to me. The fix to make strndup use strnlen should go in too. Thanks, Simon 2005-08-10 Simon Josefsson [EMAIL PROTECTED] * strndup.c: Use strnlen.h. * strnlen.h: New file. 2005-08-10 Simon Josefsson [EMAIL PROTECTED] * strnlen.m4: New file. * strndup.m4: Don't check for strnlen declaration, done in strnlen.m4. 2005-08-10 Simon Josefsson [EMAIL PROTECTED] * modules/strnlen (Files): Add strnlen.h. Index: m4/strnlen.m4 === RCS file: /cvsroot/gnulib/gnulib/m4/strnlen.m4,v retrieving revision 1.6 diff -u -p -r1.6 strnlen.m4 --- m4/strnlen.m4 23 Jan 2005 08:06:57 - 1.6 +++ m4/strnlen.m4 10 Aug 2005 10:31:34 - @@ -1,5 +1,5 @@ -# strnlen.m4 serial 4 -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +# strnlen.m4 serial 5 +dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,4 +22,6 @@ AC_DEFUN([gl_FUNC_STRNLEN], ]) # Prerequisites of lib/strnlen.c. -AC_DEFUN([gl_PREREQ_STRNLEN], [:]) +AC_DEFUN([gl_PREREQ_STRNLEN], [ + AC_CHECK_DECLS_ONCE(strnlen) +]) Index: m4/strndup.m4 === RCS file: /cvsroot/gnulib/gnulib/m4/strndup.m4,v retrieving revision 1.4 diff -u -p -r1.4 strndup.m4 --- m4/strndup.m4 21 Mar 2005 22:06:27 - 1.4 +++ m4/strndup.m4 10 Aug 2005 10:31:34 - @@ -1,4 +1,4 @@ -# strndup.m4 serial 4 +# strndup.m4 serial 5 dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,6 +18,4 @@ AC_DEFUN([gl_FUNC_STRNDUP], ]) # Prerequisites of lib/strndup.c. -AC_DEFUN([gl_PREREQ_STRNDUP], [ - AC_CHECK_DECLS(strnlen) -]) +AC_DEFUN([gl_PREREQ_STRNDUP], [:]) Index: modules/strnlen === RCS file: /cvsroot/gnulib/gnulib/modules/strnlen,v retrieving revision 1.4 diff -u -p -r1.4 strnlen --- modules/strnlen 22 Sep 2004 15:11:04 - 1.4 +++ modules/strnlen 10 Aug 2005 10:31:34 - @@ -2,6 +2,7 @@ Description: strnlen() function: determine the length of a size-bounded string. Files: +lib/strnlen.h lib/strnlen.c m4/strnlen.m4 Index: lib/strnlen.h === RCS file: lib/strnlen.h diff -N lib/strnlen.h --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/strnlen.h 10 Aug 2005 10:31:34 - @@ -0,0 +1,29 @@ +/* Find the length of STRING, but scan at most MAXLEN characters. + Copyright (C) 2005 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef STRNLEN_H +#define STRNLEN_H + +/* Get strnlen declaration, if available. */ +#include string.h + +#if defined HAVE_DECL_STRNLEN !HAVE_DECL_STRNLEN +extern size_t strnlen(const char *s, size_t maxlen); +#endif + +#endif /* STRNLEN_H */ Index: strndup.c === RCS file: /cvsroot/gnulib/gnulib/lib/strndup.c,v retrieving revision 1.11 diff -u -p -u -w -r1.11 strndup.c --- strndup.c 14 May 2005 06:03:58 - 1.11 +++ strndup.c 10 Aug 2005 10:32:23 - @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2005 Free Software Foundation, Inc. NOTE: The
Re: xvasprintf: don't depend directly on xalloc-die
Sorry, it seems the xalloc-die logic has changed, so my patch may be wrong. Specifically: 2005-07-15 Paul Eggert [EMAIL PROTECTED] * modules/xalloc (Depends-on): Add xalloc-die. * modules/xvasprintf (Depends-on): Add xalloc-die. I can't find the discussion behind this change. Why was a hard dependency on xalloc-die added? Wasn't the point of separating xalloc-die from the xmalloc module to allow applications to supply its own xalloc_die function? Right now I can't avoid the gnulib xalloc_die implementation in my library, and I want my own die-function. Thanks! Simon Josefsson [EMAIL PROTECTED] writes: Just like xmalloc doesn't have a hard dependency on xalloc-die, I don't think xvasprintf should have. Will install in a few days unless someone objects. (In Shishi, I use a custom die-function, but xvasprintf drag in the gnulib defined one... ungood.) 2005-08-10 Simon Josefsson [EMAIL PROTECTED] * modules/xvasprintf (Depends-on): Don't force xalloc-die. --- xvasprintf16 Jul 2005 21:29:14 +0200 1.4 +++ xvasprintf10 Aug 2005 16:57:14 +0200 @@ -9,7 +9,6 @@ Depends-on: vasprintf -xalloc-die configure.ac: ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib
xvasprintf: don't depend directly on xalloc-die
Just like xmalloc doesn't have a hard dependency on xalloc-die, I don't think xvasprintf should have. Will install in a few days unless someone objects. (In Shishi, I use a custom die-function, but xvasprintf drag in the gnulib defined one... ungood.) 2005-08-10 Simon Josefsson [EMAIL PROTECTED] * modules/xvasprintf (Depends-on): Don't force xalloc-die. --- xvasprintf 16 Jul 2005 21:29:14 +0200 1.4 +++ xvasprintf 10 Aug 2005 16:57:14 +0200 @@ -9,7 +9,6 @@ Depends-on: vasprintf -xalloc-die configure.ac: ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib