libargp: argp_program_version does not work
Thu Jul 11 16:35:00 GMT 2013
> 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
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
This is getting outside of my knowledge. A patch would be welcome.
Could someone with more C or Gnulib knowledge than me comment?
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin