Re: make cmd_line_list and cmd_line_list_tmp static?
Lorenzo Bettini <[email protected]>
| Newsgroups | gmane.comp.gnu.gengetopt.general |
|---|---|
| Message-ID | <[email protected]> |
Andre Noll wrote: > first of all, sorry for the delay (I was busy trying to get a job) > > On 15:31, Lorenzo Bettini wrote: > >>so I used the file you sent me and modified it so that the >>initialization takes place when optind is 1 (and not 0). >> >>I also modified the file and renamed the getopt stuffs with the prefix >>custom_; I then made everything static and include the contents of this >>file in the generated C files (in case conf or string parsers are >>generated). The customized version of getopt_long is then used by conf >>and string parsers and everything seems to work now and also valgrind >>does not find anything evil. > > > Very nice, thank you very much. > > Is there a reason to use the custom parser only from > cmdline_parser_configfile() but not from cmdline_parser()? > I'd prefer to use the standard getopt for standard command line parsing... for that it works fine ;-) > >>I also tested these features with the test_multiple_parsers test program >>that uses three parsers (and calls the string parsers many times). > > > I just tested the new version and this change finally solves the > problem of the grab command :) really happy to hear that :-D > > >>this fix makes it work, but I'd still hear from the libc people in order >>to understand whether their getopt implementation was intended like that. > > > Yes, that'd be interesting. From the cvs changelog I see that Uli > and Roland McGrath are the main authors of the getopt code in glibc. OK, that's precious information > > One minor thing: There's a missing 'void' in src/skels/c_source.h_skel > for which causes gcc to spit out > > warning: function declaration isn't a prototype > > Trivial fix below. opsss... :-) thanks! Lorenzo -- +-----------------------------------------------------+ | Lorenzo Bettini ICQ# lbetto, 16080134 | | PhD in Computer Science | | Dip. Sistemi e Informatica, Univ. di Firenze | | Florence - Italy (GNU/Linux User # 158233) | | Home Page : http://www.lorenzobettini.it | | http://music.dsi.unifi.it XKlaim language | | http://www.purplesucker.com Deep Purple Cover Band | | http://www.gnu.org/software/src-highlite | | http://www.gnu.org/software/gengetopt | | http://www.lorenzobettini.it/software/gengen | | http://www.lorenzobettini.it/software/doublecpp | +-----------------------------------------------------+