[gnu.utils.bug] Tiny bug in GNU getopt, and multiplication of sources

pinard@EDDIE.MIT.EDU (Francois Pinard) (12/31/89)

Hello, people.

GNU getopt does not declare the functions alloca nor index.  Function
alloca should return void *, and index should return char *.  This
particular getopt was part of grep 1.5, but I do not feel like
reporting this as a grep bug.

A few GNU routines get multiplied in several products.  I think of
alloca, obstack, regcmp, getopt among others (and soon, readline :-).
Most of them originated from GNU emacs, I believe; but comparing the
same routine in various products reveals that they slightly differ for
reasons not pertaining necessarily to the product in which they stand.
Maybe the time has come to develop a common library of such routines,
with a proper version numbering scheme to help comparison and
reference, and reduce multiplicity.  I suggest these would not nest in
emacs anymore, so to be able to evolve independently, in a faster and
ligthier (?) way.

bug-utils seemed (to me) the best place to discuss such matters.  If I
am in the wrong forum, please someone tell me.

-- 
Franc,ois Pinard                                    pinard@iro.umontreal.ca
(514) 588-4656           ``Vivement GNU!''          ...!uunet!iros1!pinard

djm@eng.umd.edu (David J. MacKenzie) (01/03/90)

In article <8912310022.AA20600@kovic.IRO.UMontreal.CA> mcgill-vision!iros1!pinard@EDDIE.MIT.EDU (Francois Pinard) writes:

> GNU getopt does not declare the functions alloca nor index.  Function
> alloca should return void *, and index should return char *.  This
> particular getopt was part of grep 1.5, but I do not feel like
> reporting this as a grep bug.

I fixed that on the master copy recently.  New releases of GNU
programs should automatically include the change (see below).

> Most of them originated from GNU emacs, I believe; but comparing the
> same routine in various products reveals that they slightly differ for
> reasons not pertaining necessarily to the product in which they stand.

Actually, they all are in fact symbolic links to the same copies of
the source code at the MIT AI Lab, but you obviously can't do that in
a distribution tar file.  The reason you see slightly different
versions of various GNU library files is that the distributions of
those different programs were not made all at the same time; thus,
they each got a copy of whatever happened to be the current version at
the time that they were released.  When new versions are released,
they will automagically get the new current versions of the library
files. 

In the case of grep 1.5, Mike wanted to minimize the size of the diffs
from previous versions, so he did not include the current getopt.c, or
update the copyleft messages to use the subroutinized GPL; but that is
an exception . . . .
--
David J. MacKenzie <djm@eng.umd.edu>