Web lists-archives.com

Re: [Mingw-users] Multiple definition of `vsnprintf' when building C++ programs




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/05/17 18:15, Eli Zaretskii wrote:
>> ... what is the difference between my link and yours?  Dynamic vs.
>> static linking of libmingwex, perhaps?
> 
> Yes, I link libmingwex statically.

As it is your right to choose; I respect that.

> It is of course expected that linking against a DLL will not hit this
> problem.  I'd like to avoid a dynamic link against libmingwex, because
> otherwise distributing a GDB binary would need to distribute the
> libmingwex DLL, which increases the probability of a DLL hell on the
> end-user's machines,

libmingwex.dll will be versioned, following libtool guidelines, so 
this _shouldn't_ become an issue.

> and also will require me to provide the sources for libmingwex near
> the binaries.

The MIT/X.org licence of libmingwex.dll _doesn't_ impose any such 
requirement, so unless you consider that GDB's GPL stomps on that 
freedom, then no, with the IANAL proviso, I don't think it would.

> So I hope you will find a solution that works for static linking as
> well.

Declaring snprintf and vsnprintf as weak symbols, for the libmingwex 
build, does the trick, but it isn't my preferred solution.  In fact, 
the more I look into it, the less I like the change which introduced 
the problem; I'm inclined to revert:
https://sourceforge.net/p/mingw/mingw-org-wsl/ci/c0372a60e6918ffd944670ba8502a0d99fa69044/

Apart from _completely defeating_ -Wformat checking for snprintf(), 
and vsnprintf(), (which will _always_ get it wrong WRT one or other 
of the two subsets of format specifiers which are _not_ within the 
intersection of the ms_printf and gnu_printf sets), it offers no 
real value; in fact, it seems more harmful than useful.

- -- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJZE3SKAAoJEMCtNsY0flo/y/AQAKB8K8qujxgVnOZHXpVhhszK
g6yJKhqzkyV2z+YYn4aWlMK7fchwbaJmFFhXlfmfkGsNpfTGFNXQ2yIXXA2YddD3
DNr7hayNXhUDXtvUc3WDV/m74T5aU4q4rfQmB5OLeWPOw8nU5SJ09kZuvgqc+PIs
oePpbWr8a+2P+vOEpWyTTsbCYMgRjacrHn5j8fNjr7WPAAjnjl26H+pMUtLusoA5
UGZyHEBaX6ojSXhf7BgSwu1VDkJgTVCrk+0gQVO997yEoxWmKvhdDMz1KFxdD4aH
XrhU9wuGHwhJyXzQHv1NAanuHYgj+t5/+VK1AmBPyg9HJfs6N0+omn5eXNhqKZsy
NLsl8Uvs7gMDF1P5Xwt8kh6e42tZQUnuHjxJbyRWgVb+zEfRxnBJRu4QjKWqBwRw
eK6wc9uMg2VuIIMWzII9v8cDNE3rC28iyFFeyo/iKtFp/SraAptq0dzri+sMhnNn
Oz9JbXF18JEInFMCxGM5w3MtDr7TKulhwf6IVoNlJE+btyEhI2vhMxH5/fk21MHl
xZ7QnDQrGaGjPs6t7TcFQ96H2c0DVyJeWWnCqab0EFP7CdU89lMkTC2NHz/u0eqE
co//9icaQp8jF0RHLoxhZyS/2CZ3UgE1EAV6+Z7ZkcGSlKKFUxNY/kwnxgSVcMVl
5clztlbBBexiVqK0Pa7T
=5/yz
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe