public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrew Schulman <schulman.andrew@epamail.epa.gov>
To: cygwin@cygwin.com
Subject: Re: libargp: argp_program_version does not work
Date: Fri, 12 Jul 2013 15:36:00 -0000	[thread overview]
Message-ID: <tq50u89pa1s7us0cff5rnu8k5ocumac510@4ax.com> (raw)
In-Reply-To: <002901ce7f0a$9da99420$d8fcbc60$%fedin@samsung.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

  reply	other threads:[~2013-07-12 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 10:17 Fedin Pavel
2013-07-11 16:35 ` Andrew Schulman
2013-07-11 22:02   ` Andrew Schulman
2013-07-12 14:52     ` Fedin Pavel
2013-07-12 15:36       ` Andrew Schulman [this message]
2013-07-17  9:57         ` [PATCH] Fix optional variables in libargp Fedin Pavel
2013-07-17 12:59           ` Eric Blake
2013-07-22  7:33           ` Andrew Schulman
2013-07-22  8:12             ` Pavel Fedin
2013-07-22 13:19             ` Pavel Fedin
2013-07-23 15:07               ` Andrew Schulman
2013-07-24  9:56                 ` Pavel Fedin
2022-02-18 13:30               ` Andrew Schulman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tq50u89pa1s7us0cff5rnu8k5ocumac510@4ax.com \
    --to=schulman.andrew@epamail.epa.gov \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).