After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766839 - Format / argument mismatches to printf()-like functions
Format / argument mismatches to printf()-like functions
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other NetBSD
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-24 13:50 UTC by he
Modified: 2016-10-12 11:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Match up printf() format specifiers with argument types by adding casts (3.40 KB, text/plain)
2016-05-24 13:50 UTC, he
Details

Description he 2016-05-24 13:50:03 UTC
Created attachment 328439 [details]
Match up printf() format specifiers with argument types by adding casts

At least on my platform, gcc ends up being configured to build
libxml2 using C90.  In C90, the %z format specifier which matches size_t
is not available.  On platforms where size_t is not the same underlying
type as "unsigned long", this will cause needless warnings.

The attached patch fixes this problem by adding casts so that the
type of the argument matches the printf() format specifiers.

(There is one cast which isn't related to size_t, rather, gcc claims
that the result is "unsigned int" while the format specifies "unsigned long",
it got dragged along for the ride.)
Comment 1 Nick Wellnhofer 2016-10-12 11:37:06 UTC
Fixed with the following commit:

https://git.gnome.org/browse/libxml2/commit/?id=c2545cbb6d9a87e3e0bce167eabcb8f3c9153edc