Hi,

On Sun, Aug 7, 2016 at 10:04 AM, Steffan Karger <stef...@karger.me> wrote:

> On 5 August 2016 at 15:09, Selva Nair <selva.n...@gmail.com> wrote:
> > On Fri, Aug 5, 2016 at 3:32 AM, Steffan Karger <stef...@karger.me>
> wrote:
> >> On Fri, Aug 5, 2016 at 8:14 AM, Gert Doering <g...@greenie.muc.de>
> wrote:
> >> > On Thu, Aug 04, 2016 at 11:39:54PM -0400, Selva Nair wrote:
> >> >> -  msg(D_MTU_DEBUG, "%s: Adjusting frame parameters for crypto by %zu
> >> >> bytes",
> >> >> -      __func__, crypto_overhead);
> >> >> +  msg(D_MTU_DEBUG, "%s: Adjusting frame parameters for crypto by %d
> >> >> bytes",
> >> >> +      __func__, (int) crypto_overhead);
> >> >
> >> > Just for clarification: how does this break windows?  mingw builds, or
> >> > msvc builds?  Will it print "nothing" ("zu bytes") or wrong values?
> >
> > mingw (my version is gcc 4.6.3)  prints zu bytes. I think this could be
> also
> > fixed by defining  __USE_MINGW_ANSI_STDIO=1
>
> I looked into this a bit, and it should indeed fix the printing of %zu
> on Windows.  I would prefer to teach autotools to include this flag on
> Windows builds, instead of the suggested casts in the code.  (But if
> you both prefer the casts, just ignore my rambling.)
>

I don't like casts and agree with Steffan. That is, assuming MSVC support
is only for developers, we need not worry about the runtime and could
require MSVC 2015. I suppose we only distribute mingw cross-compiled
binaries.

I think, with __USE_MINGW_ANSI_STDIO=1 mingw will use a custom
implementation I/O routines, so the binary size may increase a bit (by ~50
kB or ~5% in my tests).

Also we currently use MS-specific format specs like %I64u %I64x for
counter_format and ptr_format. Those will have to be changed once the above
define is in place. Its only a couple of instances, though.

I am looking at this as an opportunity to stop coding for VS2011 and 2013
and feel liberated :) If Gert is fine with this I'll make a new patch.

Selva

Reply via email to