On Thu, Aug 1, 2013 at 11:04 AM, Marcel Wid <[email protected]> wrote:
> Hi,
>
> the problem here is that Microsoft doesn't implement snprintf C99
> conforming. When the buffer is not big enough, Microsoft's
> implementation returns a negative value (see
> http://msdn.microsoft.com/en-us/library/2ts7cx93%28v=vs.110%29.aspx).
>
> Now mingw-w64 per default delegates a call to snprintf to Microsoft's C
> runtime and hence you get the surprising result.
>
> If you want to use an ISO C99 conforming implementation of the C
> standard library, you have to define the Macro _ISOC99_SOURCE. Then
> everything should work as expected.
>
>
Thank you Marcel and Dongsheng for your responses.
I believe I incorrectly outlined my question, is not about C99
compatibility what worries me but MinGW vs mingw-w64 behavior.
It is not clear for me why mingw.org (GCC 4.7.2) does works while mingw-w64
(GCC 4.7.2 and 4.7.3) produces the failure.
Shouldn't compatibility in this regard be considered?
>From your statements, the behavior of mingw.org is incorrect and the one of
mingw-w64 is the correct, cool with that.
Now, the suggestions about the definitions seems a bit inconsistent. Marcel
suggest usage of _ISOC99_SOURCE, Dongsheng suggest usage of
__USE_MINGW_ANSI_STDIO
Former sounds redundant considering -std=c99 has been given to the GCC to
compile, so it should treat the source as C99. The second suggestion sounds
a bit too internal, which I should now forward to rugged (libgit2
developers) and see if they can implement it in the code.
Sorry for being a bit stubborn but I want to be sure that the
recommendations given to others are consistent.
Thank you for your time.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public