X-Recipient: archive-cygwin AT delorie DOT 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:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=bg68AjQCZZHyVvm7t3a1kKqzloR1t7J4it5BY6xyZVqarOx9mbj8T mmgDGSak77lHfW5GXVHdgGP5aKFsUQuhu+kCexo/a7yT3jcfDprLS9RT4tpjzlTC 8Aa/z+Rh6yvXF95KjVAQDUGfqZ6xSBmhhpiVnRToW5eZ5FVPtWUFf4= 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:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; s=default; bh=MJhYBGXGGNh9DpZ3t/6bwPyEtz8=; b=DRM+7BP9gLyGxWtu5z54ipZjcnTK Vd0Z0Rgr+eNxztJj2glW+9gRV64CUBhj4f73B0o2ln3bwzY/tyKT/KHZ4pSSYosM VhOSRpTd/WchQ5+ZptqDUKbJ0A+E24Yp1jY4CqxjyQnq47BITb2VVwG4nVpLWdVp FyHeUvMObeMBoiI= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 To: cygwin AT cygwin DOT com From: Andrew Schulman Subject: Re: libargp: argp_program_version does not work Date: Thu, 11 Jul 2013 11:04:59 -0400 Lines: 37 Message-ID: References: <000001ce7e08$2b866830$82933890$%fedin AT samsung DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive: encrypt > 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