On 28/01/2021 04:04, Selva Nair wrote:
Hi,

Starting version 8, mingw has started automatically setting __USE_MINGW_ANSI_STDIO = 1 under some feature-set conditions: for example, when _GNU_SOURCE is defined or -std=C99, both of which are true in our case.

See: release notes at http://mingw-w64.org/doku.php <http://mingw-w64.org/doku.php>

This causes several stdio functions to use internal ISO-C compliant implementations (instead of those in msvcrt), and to break some of our swprintf family calls.

I see two options:
(i) force __USE_MINGW_ANSI_STDIO = 0 in configure.
(ii) Change all stdio function calls to be compatible building with and without this macro defined. AFICT, the only change required would be to replace %s and %S by %ls and %hs in some places -- mostly in interactive service, one instanceĀ in tun.c

Any thoughts? I'm leaning towards option (ii).

Agreed!  Option (ii) sounds most reasonable to me too.

IIRC, we've had some special wrappers with additional %-operators for string processing in the past we've kicked out as well (the struct argv patches comes to mind), and I believe there's been several other challenges with cross-platform support where we've tried to standardize to be as close to the native and most common ground available.

That mingw is moving towards similar goals replacing msvcrt with ISO-C standards is just great for us in the long run.
--
kind regards,

David Sommerseth
OpenVPN Inc


Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to