[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mingw-users
Subject:    Re: [Mingw-users] GCC 6.3.0 warns about vsnprintf
From:       Keith Marshall via MinGW-users <mingw-users () lists ! sourceforge ! net>
Date:       2017-09-09 9:39:16
Message-ID: 59B3B6C4.2010709 () users ! sourceforge ! net
[Download RAW message or body]

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

On 09/09/17 08:09, Eli Zaretskii wrote:
> > Date: Fri, 8 Sep 2017 21:02:36 +0100
> > From: Keith Marshall via MinGW-users <mingw-users@lists.sourceforge.net>
> > 
> > > But if vsnprintf is already declared as conforming to mingw_printf
> > > rules, why does GCC "suggest it to be a possible candidate" for those
> > > very rules?  Are you saying that the warning disregards the existing
> > > format attributes?
> > 
> > I think it is suggesting that your foo() is a candidate for declaration 
> > with that attribute, because it passes its own arguments to vsnprintf(), 
> > which is explicitly declared thus; certainly, that particular suggestion 
> > disappears, when foo() is so declared.
> 
> I see.  And why do you think is that warning emitted only about
> vsnprintf, but not about the other functions of the printf family?

I don't know, but as a purely speculative guess: of the entire standard 
printf() function family, MSVCRT.DLL provides all but snprintf(), and 
vsnprintf(), (instead providing non-standard variants with their names 
prefixed by an underscore).  Thus, for this pair specifically, any call 
will always resolve to a MinGW implementation, which conforms to our new 
mingw_printf format interpretation rules, whereas a call to any other printf() family \
function, by default, resolves to Microsoft's MSVCRT.DLL  implementation, which \
conforms to ms_printf format rules.  Perhaps GCC  becomes confused, when any function \
in the printf() family explicitly  does not comply with its blind (and IMO \
ill-advised) assumption that,  for any MS-Windows target, it *must* exhibit behaviour \
as defined by  ms_printf format conventions.

- -- 
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)

iQIcBAEBAgAGBQJZs7bDAAoJEMCtNsY0flo/bvQP/iExJpea/S54jwSvAtJg5UQz
5KBGg3kFgTFdE49SaTilcw0ZXxGsuohKRq00odTGGs7l5eoTsFa46KX6QhCnvIUB
s0EqyrtI9avd4WuZM073SGMhfjwx3uuJC/v06Huhw6VXyVwIAiEWLZbg4mLctfBW
lNA5aNFCtCi5X1DGYTop8DMFX9aXqr6g9CO5IceUSzGzU96vlEp/RZmnswtqTJJz
7VSAh67UwJdz+qo3C7wuF/7UPvo3miiu1xcbEnbhoerqbVbGirj2PwF61yZG83iN
RiH8S58zEfbT/V1nQni6m/jeoH5zwNTyDtW7Ie/tJ1dkZ1o3YAi5zpeGnqagpn+9
Edd4ZW8a/WlpI8tI2vBdgkvzw+/+mAHVH/fxySIwtoag2w70128d9gAWpvfQlS1Y
2sgGjtyl5q87JRbWGSFr2SxPNq3yg3VfDv2+ore27rggH0zbQoFLnHxixQrzhu1+
Ikr5pr8nmsix1vGCnfzi3DpkjMuILtoYC5b0WRz2zp2mvb8eLf+ACZa2byei8V2Z
82GAxNUK3k6DKRdISZVqbLtZKTb9GOGzkh7KNRy/YJpd94CKheKGGoke0UBXrqyv
yDBn9ozO6nBnB1s6nuUQt/ed+309m7SMx0A/o38g4r1+4NuNzCFGI/eHWuxl/bIL
tj+mDF82lYtyWNVPRrIa
=wa9U
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

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@lists.sourceforge.net?subject=unsubscribe


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic