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 762006 - Fix libxslt format string warnings
Fix libxslt format string warnings
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-13 20:50 UTC by David Kilzer
Modified: 2016-03-30 23:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch v1 (8.42 KB, patch)
2016-02-13 20:54 UTC, David Kilzer
none Details | Review
Patch v2 (8.18 KB, patch)
2016-02-16 20:05 UTC, David Kilzer
none Details | Review
Patch v3 (7.02 KB, patch)
2016-03-23 20:19 UTC, David Kilzer
none Details | Review

Description David Kilzer 2016-02-13 20:50:04 UTC
After adding __attribute__((__format__(printf, X, Y))) macros to methods that take format strings, then adding -Wformat=2 -Wmissing-format-attribute to CFLAGS exposes a couple of warnings about unused format variables:

transform.c:3610:16: warning: data argument not used by format string [-Wformat-extra-args]
                             style->method);
                             ^
transform.c:6080:3: warning: data argument not used by format string [-Wformat-extra-args]
                style->method);
                ^
Comment 1 David Kilzer 2016-02-13 20:54:14 UTC
Created attachment 321083 [details] [review]
Patch v1

Adds "-Wformat=2 -Wmissing-format-attribute", and fixes issues that it finds.
Comment 2 David Kilzer 2016-02-16 20:05:07 UTC
Created attachment 321433 [details] [review]
Patch v2

- Rename XSLT_ATTRIBUTE_PRINTF to LIBXSLT_ATTR_FORMAT (more like libxml2).
- Fix typos.
- Move macro declaration inline for static methods instead of re-declaring the methods.
Comment 3 Nick Wellnhofer 2016-02-24 17:10:34 UTC
The patch looks good, but can you remove the #pragma directives?
Comment 4 David Kilzer 2016-03-23 20:19:40 UTC
Created attachment 324622 [details] [review]
Patch v3

Removed clang pragmas per Comment #3.
Comment 5 Nick Wellnhofer 2016-03-28 14:12:03 UTC
Fixed with the following commit:

https://git.gnome.org/browse/libxslt/commit/?id=866fc3b67e8a0595a0c4950a22ee71fa43228de6
Comment 6 David Kilzer 2016-03-30 23:21:05 UTC
(In reply to Nick Wellnhofer from comment #5)
> Fixed with the following commit:
> 
> https://git.gnome.org/browse/libxslt/commit/
> ?id=866fc3b67e8a0595a0c4950a22ee71fa43228de6

Thanks Nick!
Comment 7 David Kilzer 2016-03-30 23:24:21 UTC
For anyone merging this, you may want to take these follow-up changes:

Fix error messages for unsupported methods
<https://git.gnome.org/browse/libxslt/commit/?id=569d72416e617fc18425049d4eb4c5d89062d8cf>

Fix endTimer parameter type
<https://git.gnome.org/browse/libxslt/commit/?id=8137d94d1ad0371ab2b7544fac4025b0dcb87f23>