gengetopt: bug found in gm.cc:584

Ch'Gans <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Organization WISIRC
Message-ID <[email protected]>
Hi all,

I found a bug when using --long-help, I have used genpetopt 2.17
(manually installed on a mandriva 10.1), with and without my last patch,
and the gengetopt shipped with my distro (2.12.2). All these version
lead to the bug.
I have added this printf below the bug location:
fprintf (stderr, "typestr=%s, @typestr=%p, short_opt=%s, long_opt=%s,
opt_type=%d\n", type_str, type_str, opt->short_opt, opt->long_opt,
opt->type);

[chgans@pc-laurent tmp]$ gengetopt --version
GNU gengetopt 2.17
[...]
[chgans@pc-laurent tmp]$ cat bug.ggo
option "option-noarg" - "option with no arg" required
[chgans@pc-laurent tmp]$ gengetopt < bug.ggo
[chgans@pc-laurent tmp]$ gengetopt --long-help < bug.ggo
gengetopt: bug found in gm.cc:584!!
typestr=,®
         , @typestr=0xbffff320, short_opt=(null), long_opt=option-noarg,
opt_type=0
Aborted
[chgans@pc-laurent tmp]$ /usr/bin/gengetopt --version
GNU gengetopt 2.12.2
[...]
[chgans@pc-laurent tmp]$ /usr/bin/gengetopt --long-help < bug.ggo
gengetopt:2: syntax error r
gengetopt:2: option "option-noarg" - "option with no arg" required
gengetopt:2:
[chgans@pc-laurent tmp]$ vi bug.ggo
[chgans@pc-laurent tmp]$ cat bug.ggo
option "option-noarg" - "option with no arg" yes
[chgans@pc-laurent tmp]$ /usr/bin/gengetopt --long-help < bug.ggo
gengetopt: bug found in gm.cc:572!!
Aborted
[chgans@pc-laurent tmp]$ /usr/bin/gengetopt < bug.ggo
[chgans@pc-laurent tmp]$

Regards,
Christian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.