X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:cc:references:in-reply-to:subject:date
	:message-id:mime-version:content-type:content-transfer-encoding;
	 q=dns; s=default; b=ZpAKCZMmvTe3MzJl+LisKuaKhAgF8+zOaO+XjaBjqS3
	/b3fbfqyQwK9XM7MHrWMF8nXMMbENeOYHdSOHn7DYvaA8utPDyFcySq9bpvCPHDf
	vy2M9SaI9X1RA7qgwLNBrXjtU5zKiZOcD8cwcPzsfYLFxQvruNBreYtgMRSdZA28
	=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:cc:references:in-reply-to:subject:date
	:message-id:mime-version:content-type:content-transfer-encoding;
	 s=default; bh=vqcfY/Go1+kD6AoAH4rrJXd+FkI=; b=yhDmyuTjSf/hc4UIn
	6Vp2+xAstp7A1tVbVNXGg3gYI6Cgten19lrRJF2Dno1S1/3FZWr8UASN8rIMn6PS
	S4H9cgIjQJVsM6aOe9BH9o/53Bd5bq/2Qpa+gbfH9nRDYnpGLM2mrrTSCC6EyYsv
	LeNolB/12WL2tvX4Z0Nf0I96bw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1
From: Fedin Pavel <p.fedin@samsung.com>
To: "'Andrew Schulman'" <schulman.andrew@epa.gov>
Cc: cygwin@cygwin.com
References: <000001ce7e08$2b866830$82933890$%fedin@samsung.com> <u4ett8due4p6h9ku1iumscvulp0g688tgk@4ax.com> <4q4ut8had25hqmo8b0752i8asuv6ism2qh@4ax.com>
In-reply-to: <4q4ut8had25hqmo8b0752i8asuv6ism2qh@4ax.com>
Subject: RE: libargp: argp_program_version does not work
Date: Fri, 12 Jul 2013 18:17:59 +0400
Message-id: <002901ce7f0a$9da99420$d8fcbc60$%fedin@samsung.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit

 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.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia



--
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

