[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] getopt: for ambiguous options, enumerate the possibilities.

From: Bruno Haible
Subject: Re: [PATCH] getopt: for ambiguous options, enumerate the possibilities.
Date: Mon, 16 May 2011 00:19:27 +0200
User-agent: KMail/1.9.9

Hi James,

> * lib/getopt.c (_getopt_internal_r): Merge glibc change printing
> the ambiguous options when an ambiguous prefix is given. This was
> glibc Buganizer wishlist bug 7101.

What is the "glibc Buganizer wishlist"? The issue is also in glibc's bugzilla
<http://sourceware.org/bugzilla/show_bug.cgi?id=7101>. Why not refer to that?

> -#if defined _LIBC && defined USE_IN_LIBIO

What's the point of removing the "#if defined _LIBC && defined USE_IN_LIBIO"
from the gnulib copy? It makes future merges (in both directions) easier if
we minimize the differences visible through a
"diff -w -u gnulib/lib/getopt.c glibc/posix/getopt.c"
command. I would therefore keep the pure glibc code.

> +                struct option_list *newp = alloca (sizeof (*newp));

In gnulib, we cannot use alloca() unconditionally: some compilers don't have
alloca. There are two possible workarounds:
  - Use module 'alloca-opt', and use alloca() only if HAVE_ALLOCA.
    Otherwise use malloc() or something else.
  - Use module 'malloca'.

Yes, this means manual deallocation of the constructed allocated list items.

In memoriam Dang Xuan Hoan <http://www.vietmemorial.org/myweb/thelist.html>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]