Hi, sorry for being a bit lazy in answering. This is the sort of threads that lead to endless wars ... :-)
On Sun, Aug 07, 2016 at 10:47:16AM -0400, Selva Nair wrote: > > 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. Mmmh. Trading off 3 ("easy") casts vs. 50 kB extra code for stdio instead of using the platform-provided stdio library *plus* having to change (and possibly review) quite a few other parts of the code sounds like a fairly easy trade-off to me - and my conclusion would be "drop %zu, just cast to (unsigned int)". Just to make this clear: I do not like sprinkling casts across the code "to silence the compiler" at all. It quite often hides bugs (especially when dealing with pointers). Now *these* are all very simple - talking about numbers in the numerical range "0..2000", so "%u" plus (unsigned int) would be totally safe here, no matter what platform used. > 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. This is somewhat tangential from not using %zu :) - I think regarding "which VS versions do we support", we should at least check with James and Lev, as these two seem to be the last ones to (regularily) build with MSVC... gert -- USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany g...@greenie.muc.de fax: +49-89-35655025 g...@net.informatik.tu-muenchen.de
signature.asc
Description: PGP signature