GNOME Bugzilla – Bug 762006
Fix libxslt format string warnings
Last modified: 2016-03-30 23:24:21 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); ^
Created attachment 321083 [details] [review] Patch v1 Adds "-Wformat=2 -Wmissing-format-attribute", and fixes issues that it finds.
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.
The patch looks good, but can you remove the #pragma directives?
Created attachment 324622 [details] [review] Patch v3 Removed clang pragmas per Comment #3.
Fixed with the following commit: https://git.gnome.org/browse/libxslt/commit/?id=866fc3b67e8a0595a0c4950a22ee71fa43228de6
(In reply to Nick Wellnhofer from comment #5) > Fixed with the following commit: > > https://git.gnome.org/browse/libxslt/commit/ > ?id=866fc3b67e8a0595a0c4950a22ee71fa43228de6 Thanks Nick!
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>