Web lists-archives.com

Re: [Mingw-users] snprintf and __USE_MINGW_ANSI_STDIO




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 16/11/16 16:00, Eli Zaretskii wrote:
>> From: Keith Marshall This is nothing whatsoever to do with
>> __USE_MINGW_ANSI_STDIO, (which you really SHOULDN'T define
>> yourself, BTW; use appropriate _POSIX_C_SOURCE, or _XOPEN_SOURCE
>> definitions instead).  This is just evidence of the inherent
>> dumbness of GCC's printf format warnings.
> 
> I'm not sure it's GCC dumbness: it could be that the code in
> question has some prototype that uses __attribute__ ((format
> (printf, ...))).
> 
> The solution is to use __attribute__ ((format (ms_printf, ...))) 
> instead; see the GCC manual for the details.  (Perhaps MinGW
> headers should do that themselves?)

No.  IMO, it is GCC dumbness.  See, "ms_printf" is the default for the
MinGW build of GCC; the "dumbness" arises because GCC's alternatives,
"ms_printf" vs. "printf" (or "gnu_printf") are mutually exclusive, but
our alternative to the MSVCRT.DLL printf formatting is a hybrid of the
two; (IOW, you may avoid the warnings by using MSVCRT.DLL specifiers,
as the <inttypes.h> macros do; ISO-C alternatives are equally accepted,
but GCC will complain that they are unrecognised).

- -- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJYLIkOAAoJEMCtNsY0flo/fZsP/2Ero2JP3FVnQa1NfoFCr7Ad
FlfNfcME5zzYuPdq4X+L7RgSIoa/mmt+S5M7O0DzbGR0KE1KkdWT+EmXRaMhnfRu
1Un4YY4D2zXMtREbFsZIzBIhCXLFN9kcKkFt2zfnYdYTH6XCstktuYfYv23tf0kw
ZnD4jac+1bGP8FNfHPrQgm/bFPOhEOBNKu49Eb8jSZurdkvlR1k9SGF9XFKLXwXn
gshsa6fRRc+01ymSGlVjQr5gglkEu5ryXh2syOWTP38em64z3OXPuI2PWHjwDrGa
7xVR+eNBxNgHazF3YYI+Ny0rM/sPm0M3Fy7jENggYWd3nUMPXFVupyFy6OXOF7kA
GGXkOmoZZiXqjZxbKsaHYZXyDgN2K6uxTTxC25EyfeSUP/JPGB90d0u+2W23weoh
pGKFyc/+hMVKyIUp3PqskBQu+hcbIoLr7ihFBIXWXaP1YwzMWf6MwbXGjXnab3fU
VGpLfl7NuC9Yx0YVtmq21ObLJ1NdwGyXMsLTKyZ9JALgDYBvzr6UrARc2I+E7zdW
u4sZ/aLEOALSHScLjfJ64eDk1eTWgDuA+rRb+PESX85tZW9W2Jz01dtXk4kvJla1
QrjpkO3BhDnoeXJTzz0HHORzllP+kReWYVTnv+RPEDb0/A6bz7TfF+4EogerosMf
++1/1JF9R2dzJAGlW+pC
=2Spc
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe