Bruno Haible | 3 Mar 2003 18:25

Re: Re: mbswidth.c portability fix for UnixWare 7.1.1

Paul Eggert writes:
> I installed the following patch into Bison.  OK to check into gnulib?
> It seems pretty straightforward.
> 
> 2003-02-28  Paul Eggert  <eggert <at> twinsun.com>
> 
> 	* lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
> 	around a UnixWare 7.1.1 porting bug reported by John Hughes in
> 	<http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.

I prefer to fix this by changing mbswidth.h to do the

#if HAVE_WCHAR_H
# include <wchar.h>
#endif

This way
  1. the ordering problem will be fixed not only in mbswidth.c but
     also in other files that happen to use both mbswidth.h and
     wchar.h (such as ls.c),
  2. the specification header can be kept being included first,
     after only "config.h" and <alloca.h>, which is a generally useful
     rule.

Bruno
Paul Eggert | 10 Mar 2003 08:34

argmatch.c EXIT_FAILURE patch

I installed this patch to port argmatch.c to SunOS 4.1.4 + GCC 2.7.2.3.

2003-03-09  Paul Eggert  <eggert <at> twinsun.com>

	* argmatch.c (EXIT_FAILURE): Define if the system doesn't.
	Reported by Bruce Becker; see:
	http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html

--- argmatch.c	21 Nov 2002 20:15:39 -0000	1.29
+++ argmatch.c	10 Mar 2003 07:31:50 -0000	1.30
 <at>  <at>  -1,5 +1,7  <at>  <at> 
 /* argmatch.c -- find a match for a string in an array
-   Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+
+   Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003 Free Software
+   Foundation, Inc.

    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
 <at>  <at>  -42,6 +44,10  <at>  <at> 
    literal_quoting_style.  */
 #ifndef ARGMATCH_QUOTING_STYLE
 # define ARGMATCH_QUOTING_STYLE locale_quoting_style
+#endif
+
+#ifndef EXIT_FAILURE
+# define EXIT_FAILURE 1
 #endif

 /* Non failing version of argmatch call this function after failing. */
(Continue reading)

Niels Möller | 13 Mar 2003 20:07
Picon
Picon
Picon
Favicon

ANNOUNCE: argp-standalone-1.2

For a few years now, I've been maintaining a standalone version of
argp. My primary use for it is for inclusion in the LSH distribution,
but it's useful for any package that wants to use argp and at the same
time be portable to non-glibc systems.

Besides portability fixes, there are a few other changes in my
version. The most important is that it no longer builds upon getopt;
the one or two hairy functions of GNU getopt are incorporated with the
argp parser. There are longer any global variables keeping track of
the parser state.

Another new feature (which has to be enabled with a compile time hack)
is abbreviations of long options, similar to emacs' complete.el. I
think that's nice, but it's such a big change to the user interface of
argp-using programs that it is currently disabled. If GNU folks agree
that allowing such abbreviations is a good thing, then it should be
enabled (and I don't think it makes sense to make it configurable on
at compile time or run time; it's just confusing if some GNU programs
take abbreviations and others don't).

New for the 1.2 release, besides an occasional bugfix and some
portability fixes, is a small testsuite that you can invoke with make
check.

The package builds a libargp.a, but the Makefile.* won't install any
files. I imagine that the main use of this package is to include it as
an AC_CONFIG_SUBDIRS:ed sub directory in other packages, not to
install argp itself into $prefix.

Finally, I think it would be a good thing to merge the code back into
(Continue reading)

Paul Eggert | 13 Mar 2003 20:54
Favicon

hash.c cleanup for stdbool.h

The following minor cleanup patch merges a change in Bison back into
gnulib.

2003-03-13  Paul Eggert  <eggert <at> twinsun.com>

	* hash.c: Include <stdbool.h> unconditionally.

--- lib/hash.c	28 Nov 2002 00:34:24 -0000	1.30
+++ lib/hash.c	13 Mar 2003 19:44:25 -0000	1.31
 <at>  <at>  -1,5 +1,8  <at>  <at> 
 /* hash - hashing table processing.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+   Foundation, Inc.
+
    Written by Jim Meyering, 1992.

    This program is free software; you can redistribute it and/or modify
 <at>  <at>  -27,11 +30,8  <at>  <at> 
 #if HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
-#if HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-typedef enum {false = 0, true = 1} bool;
-#endif
+
+#include <stdbool.h>
(Continue reading)

Paul Eggert | 13 Mar 2003 22:19
Favicon

obstack.h port to IRIX 6.5 (native c89)

I installed the following gnulib patch to merge changes from Bison.
Hmm, I suppose someone needs to merge glibc obstack.h with gnulib
obstack.h at some point?  I'm not quite sure of the relationship here.

2003-03-13  Paul Eggert  <eggert <at> twinsun.com>

	* obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
	(void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
	when compiling Bison 1.875's `bitset bset = obstack_alloc
	(bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.

--- lib/obstack.h	18 Nov 2000 09:53:33 -0000	1.17
+++ lib/obstack.h	13 Mar 2003 21:13:59 -0000	1.18
 <at>  <at>  -1,5 +1,5  <at>  <at> 
 /* obstack.h - object stack macros
-   Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
+   Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99,2003 Free Software Foundation, Inc.

    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
 <at>  <at>  -123,7 +123,11  <at>  <at>  extern "C" {
 #endif

 #ifndef __INT_TO_PTR
+#if defined __STDC__ && __STDC__
+# define __INT_TO_PTR(P) ((void *) ((P) + (char *) 0))
+#else
 # define __INT_TO_PTR(P) ((P) + (char *) 0)
+#endif
 #endif
(Continue reading)

Paul Eggert | 13 Mar 2003 22:33
Favicon

onceonly.m4 quoting fixes

Yesterday I merged gnulib into Bison, and ran into a problem with
onceonly.m4: it didn't quote its results correctly, and the resulting
'configure' file contained improperly expanded gibberish.  I'm not
quite sure why it happened, though when I inspected onceonly.m4 it was
clear that there were some quoting problems, and when I fixed the
quoting problems the bug went away.  So, here's the patch that I
installed into Bison yesterday, and into gnulib today.

This code uses defn rather than m4_defn, because that's the style of
the existing code, I guess for portability to older Autoconfs.  We do
need something like m4_quote to quote correctly, so I've added a
definition for that (again, for older Autoconfs).

Now that I've checked in the patch I see that I replaced [./-] with
[-./] as well.  This shouldn't make a difference, but at some point
during debugging it seemed to matter, so I left that change in.
(Anyway, it's in ASCII order now.  :-)

2003-03-13  Paul Eggert  <eggert <at> twinsun.com>

	* onceonly.m4 (m4_quote): New macro.
	(AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
	Quote AC_FOREACH variable-expansions properly.

--- m4/onceonly.m4	31 Dec 2002 13:42:07 -0000	1.1
+++ m4/onceonly.m4	13 Mar 2003 21:23:43 -0000	1.2
 <at>  <at>  -1,5 +1,5  <at>  <at> 
-# onceonly.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# onceonly.m4 serial 2
(Continue reading)

Miles Bader | 14 Mar 2003 03:11
Picon
Picon

Re: ANNOUNCE: argp-standalone-1.2

nisse <at> lysator.liu.se (Niels Möller) writes:
> Finally, I think it would be a good thing to merge the code back into
> glibc, but I honestly don't know when that will happen.

Yeah, sorry about that...  I know I keep saying I will and then never do
anything; I really do still intend to do it, just can never find the
time to do it.

Flaky as ever,

-Miles
--

-- 
Next to fried food, the South has suffered most from oratory.
  			-- Walter Hines Page
Niels Möller | 14 Mar 2003 09:20
Picon
Picon
Picon
Favicon

Re: ANNOUNCE: argp-standalone-1.2

Miles Bader <miles <at> lsi.nec.co.jp> writes:

> Yeah, sorry about that...  I know I keep saying I will and then never do
> anything; I really do still intend to do it, just can never find the
> time to do it.

I'll keep reminding you...

But I cc:ed the announcement to you not primarily for the reminder
value, but because I thought you wanted to know.

I browsed the glibc cvs before sending the announcements. There seems
to be some significant changes there, to argp-fmtstream.c. Luckily,
that's a file I haven't made much changes to. I haven't tried merging
the glibc changes into my version, perhaps I should.

Regards,
/Niels
Miles Bader | 14 Mar 2003 09:47
Picon
Picon

Re: ANNOUNCE: argp-standalone-1.2

nisse <at> lysator.liu.se (Niels Möller) writes:
> I browsed the glibc cvs before sending the announcements. There seems
> to be some significant changes there, to argp-fmtstream.c. Luckily,
> that's a file I haven't made much changes to. I haven't tried merging
> the glibc changes into my version, perhaps I should.

That would probably be very useful; for merging, it's obviously easiest
if your version is a strict superset (features/bug-fixes) of the glibc
version.

Thanks,

-Miles
--

-- 
80% of success is just showing up.  --Woody Allen
Jim Meyering | 14 Mar 2003 11:37
Gravatar

obstack.h: a minor const-correctness change

I've just checked in this change.
Without it, I'd get a warning for a use of obstack_object_size
in coreutils/src/remove.c.

	* obstack.h (obstack_object_size): Declare temporary, __o,
	to be const, in order to avoid warnings.
	(obstack_room): Likewise.
	(obstack_empty_p): Likewise.

Index: obstack.h
===================================================================
RCS file: /fetish/cu/lib/obstack.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -u -r1.17 -r1.18
--- obstack.h	18 Nov 2000 09:53:33 -0000	1.17
+++ obstack.h	20 Jan 2003 15:45:53 -0000	1.18
 <at>  <at>  -368,12 +368,12  <at>  <at>  extern int obstack_exit_failure;

 # define obstack_object_size(OBSTACK)					\
   __extension__								\
-  ({ struct obstack *__o = (OBSTACK);					\
+  ({ struct obstack const *__o = (OBSTACK);				\
      (unsigned) (__o->next_free - __o->object_base); })

 # define obstack_room(OBSTACK)						\
   __extension__								\
-  ({ struct obstack *__o = (OBSTACK);					\
+  ({ struct obstack const *__o = (OBSTACK);				\
      (unsigned) (__o->chunk_limit - __o->next_free); })
(Continue reading)


Gmane