[Top][All Lists]

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

Re: [help-gengetopt] make cmd_line_list and cmd_line_list_tmp static?

From: Lorenzo Bettini
Subject: Re: [help-gengetopt] make cmd_line_list and cmd_line_list_tmp static?
Date: Tue, 16 May 2006 21:56:43 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

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... :-)


|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        :    |
|         XKlaim language  |
| Deep Purple Cover Band |
|           |
|              |
|       |
|    |

reply via email to

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