From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23569 invoked by alias); 11 Jul 2013 15:07:47 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 23560 invoked by uid 89); 11 Jul 2013 15:07:47 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 11 Jul 2013 15:07:45 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UxISj-00053Z-Ux for cygwin@cygwin.com; Thu, 11 Jul 2013 17:07:17 +0200 Received: from c-69-140-37-22.hsd1.md.comcast.net ([69.140.37.22]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Jul 2013 17:07:17 +0200 Received: from schulman.andrew by c-69-140-37-22.hsd1.md.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Jul 2013 17:07:17 +0200 To: cygwin@cygwin.com From: Andrew Schulman Subject: Re: libargp: argp_program_version does not work Date: Thu, 11 Jul 2013 16:35:00 -0000 Message-ID: References: <000001ce7e08$2b866830$82933890$%fedin@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive: encrypt X-SW-Source: 2013-07/txt/msg00224.txt.bz2 > Hello! > > I have found a problem: argp_program_version string is ignored by libargp. Hi Pavel. Thanks for reporting this. I confirm your observation. For example, when I compile argp's example #2 (http://www.gnu.org/software/libc/manual/html_node/Argp-Example-2.html#Argp-Example-2), the --version option doesn't work. > I guess the problem happens because of DLL's nature. DLLs cannot contain > unresolved symbols, so the DLL has own version of argp_program_version which > is always initialized to NULL. There's no way to override it. Also confirmed. argp.h declares argp_program_version as extern const char *argp_program_version; But gllib/argp-pv.c initializes it as const char *argp_program_version = (const char *) 0 Whether there's a way to override that value by one declared in the user's code, I don't know. Maybe a linker switch? The same problem also applies to argp_program_bug_address, which is also extern const char *. > Is it possible to fix this somehow ? I guess it can be done if we move this > variable to libargp.dll.a stub library. In this case, a static definition of > this variable will be picked up from there if there's no definition in the > program. This is getting outside of my knowledge. A patch would be welcome. Could someone with more C or Gnulib knowledge than me comment? Andrew -- 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