[PATCH] Helpers: move some date related function to qt-gui.cpp

Jef Driesen jefdriesen at telenet.be
Tue Oct 15 06:54:17 UTC 2013


On 2013-10-15 15:14, Lubomir I. Ivanov wrote:
> MinGW support for *printf and parameter positions (e.g. %1$d)
> is horribly broken. Instead of implementing *proper* support
> for this feature Microsoft decide to ignore the standard (again)
> and they implement new functions with the '_p' suffix,
> such as 'sprintf_p', which seem to be available from a 2003 runtime.
> To top that 'sprintf_p' is not really a 'sprintf' but rather
> a 'snprintf'.
> 
> It seems that the MinGW people ignore the issue and do not provide
> wrappers of any sort, or at least for the current recommended compiler
> for Qt 4.8.5 on Windows - which is a 4.4.0. A note of warning;
> inspecting how MinGW does certain things in headers such as stdio.h,
> can ensue bad dreams or other negative effects on to the viewer.

The mingw compiler links your code against the Microsoft C library 
(msvcrt). Thus if the msvcrt library is broken (e.g. no C99 support!), 
then there is not much mingw can do about that.

However, I believe mingw does provide it's own replacement 
implementation for the printf functions. Those work very well for me, 
but I never tried to used positional parameters, so don't take my word 
on that.

Maybe you end up calling the Microsoft functions for some reason?

http://web.archive.org/web/20120504105123/http://sourceforge.net/project/shownotes.php?release_id=24832

Jef


More information about the subsurface mailing list