Merge getopt from gnulib to glibc and vice versa, eliminate __need_getopt

Paul Eggert eggert@cs.ucla.edu
Thu Apr 6 22:48:00 GMT 2017


Thanks for doing this, as Gnulib and Glibc should be 
better-synchronized. In the interests of helping this move along, I 
installed your proposed changes into Gnulib, with the attached 
additional minor patches, the first of which I hope you can incorporate 
into your Glibc proposal (the second patch is Gnulib-only). Perhaps 
other reviewers will come up with other Gnulib and/or Glibc 
improvements, but one step at a time. Three thoughts:

* Gnulib lib/getopt_cdefs.in.h, lib/getopt_core.h, lib/getopt_ext.h, 
lib/getopt_pfx_core.h, and lib/getopt_pfx_ext.h now all have comments 
saying "Unlike most bits headers, it does not have a protective #error, 
because the guard macro for getopt.h in gnulib is not fixed." What sort 
of Gnulib fix did you have in mind? Is this something we can easily fix 
in Gnulib now?

* From Gnulib's point of view, perhaps it would be better to define a 
module for sys/cdefs.h, and have the Gnulib getopt-posix module depend 
on this new module. That way, other Gnulib code could assume a standard 
GNU system which has sys/cdefs.h. Does this seem like a reasonable way 
forward to you? It shouldn't affect glibc code, other than perhaps to 
simplify it a bit.

* Although the Gnulib project prefers to omit leading tabs in .c and .h 
files, it's OK to put tabs in files shared from glibc, at least while 
we're doing this merge. I suppose Gnulib developers who prefer to avoid 
tabs can expand them later, once the merging is done. Personally I would 
rather let sleeping dogs lie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-getopt-posix-use-angle-bracket-include.patch
Type: application/x-patch
Size: 998 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170406/b4228371/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-getopt-gnu-omit-some-duplicate-code.patch
Type: application/x-patch
Size: 2342 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170406/b4228371/attachment-0001.bin>


More information about the Libc-alpha mailing list