This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: libargp: argp_program_version does not work
- From: Andrew Schulman <schulman dot andrew at epamail dot epa dot gov>
- To: cygwin at cygwin dot com
- Date: Fri, 12 Jul 2013 10:51:51 -0400
- Subject: Re: libargp: argp_program_version does not work
- References: <000001ce7e08$2b866830$82933890$%fedin at samsung dot com> <u4ett8due4p6h9ku1iumscvulp0g688tgk at 4ax dot com> <4q4ut8had25hqmo8b0752i8asuv6ism2qh at 4ax dot com> <002901ce7f0a$9da99420$d8fcbc60$%fedin at samsung dot com>
> Hello!
>
> > int main (int argc, char **argv)
> > {
> > argp_program_version = version;
> > argp_program_bug_address = bug_address;
> >
> > argp_parse (&argp, argc, argv, 0, 0, 0); }
> >
> > /*** End modified argp example #2 ***/
> >
> > If you compile the above version, you'll see that the --version option
> > and bug tracker text are available.
> >
> > I'm sure this problem is familiar to developers and users of shared
> > libraries, but I had forgotten it. I'll add a note to the Cygwin
> > README file, to help all of us remember it next time.
>
> Yes, i know this. But looks like nobody actually follows your way, because
> under Linux simple redefinition perfectly works.
> Of course we could fix every program, but i have an idea how to make the
> original Linux code working:
> 1. Inside DLL we should rename this variables somehow
> 2. Inside libargp.a.dll we should have a constructor function (with
> __attribute__((constructor))) which assigns variables inside DLL with
> contents of argp_program_version and argp_program_bug_address.
> 3. Also inside libargp.a.dll we should have default definitions of these
> variables with NULL contents.
>
> This way code modification would not be required any more.
> I'll try to implement this when have more time.
Okay, well I agree that this sounds like a good solution. For now you have
a workaround, and I'll be glad to consider a patch if you submit one.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple