Standardness of swprintf

Okay, I have two different versions for swprintf()'s prototype.

VC++ and GCC say it's
swprintf(wchar_t *,int,const wchar_t *,...);

But MinGW says it's
swprintf(wchar_t *,const wchar_t *,...);

Which one should I listen to?
Last edited on
Apparently VC++ and GCC are correct (to the latest C standards).

See here for the C language specification:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
From msdn:
In Visual C++ 2005, swprintf conforms to the ISO C Standard, which requires the second parameter, count, of type size_t. To force the old nonstandard behavior, define _CRT_NON_CONFORMING_SWPRINTFS. In a future version, the old behavior may be removed, so code should be changed to use the new conformant behavior.
( http://msdn.microsoft.com/en-us/library/ybk95axf.aspx )
Yeah, I thought so.

I ended up using an intermediate function and compiler-defined macros.
Topic archived. No new replies allowed.