|
|
6dedca |
From 671658873655a1bb1e478894c0c71f9c98968fff Mon Sep 17 00:00:00 2001
|
|
|
6dedca |
From: David Kilzer <ddkilzer@webkit.org>
|
|
|
6dedca |
Date: Fri, 13 May 2016 15:13:17 +0800
|
|
|
6dedca |
Subject: [PATCH] Fix some format string warnings with possible format string
|
|
|
6dedca |
vulnerability
|
|
|
6dedca |
To: libvir-list@redhat.com
|
|
|
6dedca |
|
|
|
6dedca |
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
|
|
|
6dedca |
|
|
|
6dedca |
Decorate every method in libxml2 with the appropriate
|
|
|
6dedca |
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
|
|
|
6dedca |
following the reports.
|
|
|
6dedca |
|
|
|
6dedca |
Signed-off-by: Daniel Veillard <veillard@redhat.com>
|
|
|
6dedca |
---
|
|
|
6dedca |
HTMLparser.c | 4 +--
|
|
|
6dedca |
SAX2.c | 12 ++++----
|
|
|
6dedca |
catalog.c | 2 +-
|
|
|
6dedca |
configure.in | 4 +--
|
|
|
6dedca |
debugXML.c | 4 +--
|
|
|
6dedca |
encoding.c | 2 +-
|
|
|
6dedca |
entities.c | 2 +-
|
|
|
6dedca |
error.c | 2 +-
|
|
|
6dedca |
include/libxml/parserInternals.h | 2 +-
|
|
|
6dedca |
include/libxml/xmlerror.h | 2 +-
|
|
|
6dedca |
include/libxml/xmlstring.h | 8 ++---
|
|
|
6dedca |
libxml.h | 2 +-
|
|
|
6dedca |
parser.c | 37 +++++++++++-----------
|
|
|
6dedca |
parserInternals.c | 4 +--
|
|
|
6dedca |
relaxng.c | 4 +--
|
|
|
6dedca |
schematron.c | 2 +-
|
|
|
6dedca |
testModule.c | 2 +-
|
|
|
6dedca |
valid.c | 8 ++---
|
|
|
6dedca |
xinclude.c | 4 +--
|
|
|
6dedca |
xmlIO.c | 14 ++++-----
|
|
|
6dedca |
xmllint.c | 20 ++++++------
|
|
|
6dedca |
xmlreader.c | 16 +++++++---
|
|
|
6dedca |
xmlschemas.c | 66 ++++++++++++++++++++--------------------
|
|
|
6dedca |
xmlstring.c | 4 +--
|
|
|
6dedca |
xmlwriter.c | 4 +--
|
|
|
6dedca |
xpath.c | 2 +-
|
|
|
6dedca |
xpointer.c | 2 +-
|
|
|
6dedca |
27 files changed, 121 insertions(+), 114 deletions(-)
|
|
|
6dedca |
|
|
|
6dedca |
diff --git a/HTMLparser.c b/HTMLparser.c
|
|
|
6dedca |
index e7d802d..cd5ab05 100644
|
|
|
6dedca |
--- a/HTMLparser.c
|
|
|
6dedca |
+++ b/HTMLparser.c
|
|
|
6dedca |
@@ -105,7 +105,7 @@ htmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, const xmlChar *str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -132,7 +132,7 @@ htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, int val)
|
|
|
6dedca |
{
|
|
|
6dedca |
diff --git a/SAX2.c b/SAX2.c
|
|
|
6dedca |
index 4adf202..d90f449 100644
|
|
|
6dedca |
--- a/SAX2.c
|
|
|
6dedca |
+++ b/SAX2.c
|
|
|
6dedca |
@@ -55,7 +55,7 @@
|
|
|
6dedca |
* @ctxt: an XML validation parser context
|
|
|
6dedca |
* @msg: a string to accompany the error message
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(2,0)
|
|
|
6dedca |
xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) {
|
|
|
6dedca |
xmlStructuredErrorFunc schannel = NULL;
|
|
|
6dedca |
const char *str1 = "out of memory\n";
|
|
|
6dedca |
@@ -93,7 +93,7 @@ xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) {
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validation error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const char *str1, const char *str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -133,7 +133,7 @@ xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, const xmlChar *str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -164,7 +164,7 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a parser warning
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -189,7 +189,7 @@ xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a namespace error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, const xmlChar *str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -213,7 +213,7 @@ xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a namespace warning
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, const xmlChar *str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
diff --git a/catalog.c b/catalog.c
|
|
|
6dedca |
index 8e34cd2..5c9f6de 100644
|
|
|
6dedca |
--- a/catalog.c
|
|
|
6dedca |
+++ b/catalog.c
|
|
|
6dedca |
@@ -238,7 +238,7 @@ xmlCatalogErrMemory(const char *extra)
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a catalog error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, const xmlChar *str2,
|
|
|
6dedca |
const xmlChar *str3)
|
|
|
6dedca |
diff --git a/configure.in b/configure.in
|
|
|
6dedca |
index d449b11..1dee5ba 100644
|
|
|
6dedca |
--- a/configure.in
|
|
|
6dedca |
+++ b/configure.in
|
|
|
6dedca |
@@ -705,7 +705,7 @@ else
|
|
|
6dedca |
fi
|
|
|
6dedca |
|
|
|
6dedca |
# warnings we'd like to see
|
|
|
6dedca |
- CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
|
|
|
6dedca |
+ CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
|
|
|
6dedca |
# warnings we'd like to supress
|
|
|
6dedca |
CFLAGS="${CFLAGS} -Wno-long-long"
|
|
|
6dedca |
case "${host}" in
|
|
|
6dedca |
@@ -920,7 +920,7 @@ if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \
|
|
|
6dedca |
fi
|
|
|
6dedca |
fi
|
|
|
6dedca |
if test "${GCC}" = "yes" ; then
|
|
|
6dedca |
- CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
|
|
|
6dedca |
+ CFLAGS="-g -O -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
|
|
|
6dedca |
fi
|
|
|
6dedca |
STATIC_BINARIES="-static"
|
|
|
6dedca |
dnl -Wcast-qual -ansi
|
|
|
6dedca |
diff --git a/debugXML.c b/debugXML.c
|
|
|
6dedca |
index c8efe6a..b6e7b2f 100644
|
|
|
6dedca |
--- a/debugXML.c
|
|
|
6dedca |
+++ b/debugXML.c
|
|
|
6dedca |
@@ -164,7 +164,7 @@ xmlDebugErr(xmlDebugCtxtPtr ctxt, int error, const char *msg)
|
|
|
6dedca |
NULL, NULL, NULL, 0, 0,
|
|
|
6dedca |
"%s", msg);
|
|
|
6dedca |
}
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra)
|
|
|
6dedca |
{
|
|
|
6dedca |
ctxt->errors++;
|
|
|
6dedca |
@@ -174,7 +174,7 @@ xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra)
|
|
|
6dedca |
NULL, NULL, NULL, 0, 0,
|
|
|
6dedca |
msg, extra);
|
|
|
6dedca |
}
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra)
|
|
|
6dedca |
{
|
|
|
6dedca |
ctxt->errors++;
|
|
|
6dedca |
diff --git a/encoding.c b/encoding.c
|
|
|
6dedca |
index 7330e90..dd62b3a 100644
|
|
|
6dedca |
--- a/encoding.c
|
|
|
6dedca |
+++ b/encoding.c
|
|
|
6dedca |
@@ -93,7 +93,7 @@ xmlEncodingErrMemory(const char *extra)
|
|
|
6dedca |
*
|
|
|
6dedca |
* n encoding error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(2,0)
|
|
|
6dedca |
xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val)
|
|
|
6dedca |
{
|
|
|
6dedca |
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL,
|
|
|
6dedca |
diff --git a/entities.c b/entities.c
|
|
|
6dedca |
index 0c484a7..f330959 100644
|
|
|
6dedca |
--- a/entities.c
|
|
|
6dedca |
+++ b/entities.c
|
|
|
6dedca |
@@ -83,7 +83,7 @@ xmlEntitiesErrMemory(const char *extra)
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle an out of memory condition
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(2,0)
|
|
|
6dedca |
xmlEntitiesErr(xmlParserErrors code, const char *msg)
|
|
|
6dedca |
{
|
|
|
6dedca |
__xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL);
|
|
|
6dedca |
diff --git a/error.c b/error.c
|
|
|
6dedca |
index 9c45040..2e8dfce 100644
|
|
|
6dedca |
--- a/error.c
|
|
|
6dedca |
+++ b/error.c
|
|
|
6dedca |
@@ -18,7 +18,7 @@
|
|
|
6dedca |
|
|
|
6dedca |
void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
|
|
|
6dedca |
const char *msg,
|
|
|
6dedca |
- ...);
|
|
|
6dedca |
+ ...) LIBXML_ATTR_FORMAT(2,3);
|
|
|
6dedca |
|
|
|
6dedca |
#define XML_GET_VAR_STR(msg, str) { \
|
|
|
6dedca |
int size, prev_size = -1; \
|
|
|
6dedca |
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
|
|
|
6dedca |
index 6065320..f30fc68 100644
|
|
|
6dedca |
--- a/include/libxml/parserInternals.h
|
|
|
6dedca |
+++ b/include/libxml/parserInternals.h
|
|
|
6dedca |
@@ -351,7 +351,7 @@ XMLPUBFUN void XMLCALL
|
|
|
6dedca |
xmlParserErrors xmlerr,
|
|
|
6dedca |
const char *msg,
|
|
|
6dedca |
const xmlChar * str1,
|
|
|
6dedca |
- const xmlChar * str2);
|
|
|
6dedca |
+ const xmlChar * str2) LIBXML_ATTR_FORMAT(3,0);
|
|
|
6dedca |
#endif
|
|
|
6dedca |
|
|
|
6dedca |
/**
|
|
|
6dedca |
diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h
|
|
|
6dedca |
index 537a396..acd2cd7 100644
|
|
|
6dedca |
--- a/include/libxml/xmlerror.h
|
|
|
6dedca |
+++ b/include/libxml/xmlerror.h
|
|
|
6dedca |
@@ -937,7 +937,7 @@ XMLPUBFUN void XMLCALL
|
|
|
6dedca |
int code,
|
|
|
6dedca |
xmlNodePtr node,
|
|
|
6dedca |
const char *msg,
|
|
|
6dedca |
- const char *extra);
|
|
|
6dedca |
+ const char *extra) LIBXML_ATTR_FORMAT(4,0);
|
|
|
6dedca |
#endif
|
|
|
6dedca |
#ifdef __cplusplus
|
|
|
6dedca |
}
|
|
|
6dedca |
diff --git a/include/libxml/xmlstring.h b/include/libxml/xmlstring.h
|
|
|
6dedca |
index 2036236..2d0b2d1 100644
|
|
|
6dedca |
--- a/include/libxml/xmlstring.h
|
|
|
6dedca |
+++ b/include/libxml/xmlstring.h
|
|
|
6dedca |
@@ -97,13 +97,13 @@ XMLPUBFUN xmlChar * XMLCALL
|
|
|
6dedca |
XMLPUBFUN int XMLCALL
|
|
|
6dedca |
xmlStrPrintf (xmlChar *buf,
|
|
|
6dedca |
int len,
|
|
|
6dedca |
- const xmlChar *msg,
|
|
|
6dedca |
- ...);
|
|
|
6dedca |
+ const char *msg,
|
|
|
6dedca |
+ ...) LIBXML_ATTR_FORMAT(3,4);
|
|
|
6dedca |
XMLPUBFUN int XMLCALL
|
|
|
6dedca |
xmlStrVPrintf (xmlChar *buf,
|
|
|
6dedca |
int len,
|
|
|
6dedca |
- const xmlChar *msg,
|
|
|
6dedca |
- va_list ap);
|
|
|
6dedca |
+ const char *msg,
|
|
|
6dedca |
+ va_list ap) LIBXML_ATTR_FORMAT(3,0);
|
|
|
6dedca |
|
|
|
6dedca |
XMLPUBFUN int XMLCALL
|
|
|
6dedca |
xmlGetUTF8Char (const unsigned char *utf,
|
|
|
6dedca |
diff --git a/libxml.h b/libxml.h
|
|
|
6dedca |
index 2da9044..4558b70 100644
|
|
|
6dedca |
--- a/libxml.h
|
|
|
6dedca |
+++ b/libxml.h
|
|
|
6dedca |
@@ -68,7 +68,7 @@ extern int __xmlRegisterCallbacks;
|
|
|
6dedca |
* internal error reporting routines, shared but not partof the API.
|
|
|
6dedca |
*/
|
|
|
6dedca |
void __xmlIOErr(int domain, int code, const char *extra);
|
|
|
6dedca |
-void __xmlLoaderErr(void *ctx, const char *msg, const char *filename);
|
|
|
6dedca |
+void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2,0);
|
|
|
6dedca |
#ifdef LIBXML_HTML_ENABLED
|
|
|
6dedca |
/*
|
|
|
6dedca |
* internal function of HTML parser needed for xmlParseInNodeContext
|
|
|
6dedca |
diff --git a/parser.c b/parser.c
|
|
|
6dedca |
index 2ae44c5..7413596 100644
|
|
|
6dedca |
--- a/parser.c
|
|
|
6dedca |
+++ b/parser.c
|
|
|
6dedca |
@@ -350,7 +350,6 @@ static void
|
|
|
6dedca |
xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info)
|
|
|
6dedca |
{
|
|
|
6dedca |
const char *errmsg;
|
|
|
6dedca |
- char errstr[129] = "";
|
|
|
6dedca |
|
|
|
6dedca |
if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
|
|
|
6dedca |
(ctxt->instate == XML_PARSER_EOF))
|
|
|
6dedca |
@@ -537,15 +536,17 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info)
|
|
|
6dedca |
default:
|
|
|
6dedca |
errmsg = "Unregistered error message";
|
|
|
6dedca |
}
|
|
|
6dedca |
- if (info == NULL)
|
|
|
6dedca |
- snprintf(errstr, 128, "%s\n", errmsg);
|
|
|
6dedca |
- else
|
|
|
6dedca |
- snprintf(errstr, 128, "%s: %%s\n", errmsg);
|
|
|
6dedca |
if (ctxt != NULL)
|
|
|
6dedca |
ctxt->errNo = error;
|
|
|
6dedca |
- __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
|
|
|
6dedca |
- XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, &errstr[0],
|
|
|
6dedca |
- info);
|
|
|
6dedca |
+ if (info == NULL) {
|
|
|
6dedca |
+ __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
|
|
|
6dedca |
+ XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s\n",
|
|
|
6dedca |
+ errmsg);
|
|
|
6dedca |
+ } else {
|
|
|
6dedca |
+ __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
|
|
|
6dedca |
+ XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s: %s\n",
|
|
|
6dedca |
+ errmsg, info);
|
|
|
6dedca |
+ }
|
|
|
6dedca |
if (ctxt != NULL) {
|
|
|
6dedca |
ctxt->wellFormed = 0;
|
|
|
6dedca |
if (ctxt->recovery == 0)
|
|
|
6dedca |
@@ -561,7 +562,7 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info)
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -589,7 +590,7 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a warning.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, const xmlChar *str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -627,7 +628,7 @@ xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validity error.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlValidityError(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, const xmlChar *str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -667,7 +668,7 @@ xmlValidityError(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlFatalErrMsgInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, int val)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -697,7 +698,7 @@ xmlFatalErrMsgInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlFatalErrMsgStrIntStr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar *str1, int val,
|
|
|
6dedca |
const xmlChar *str2)
|
|
|
6dedca |
@@ -727,7 +728,7 @@ xmlFatalErrMsgStrIntStr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlFatalErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar * val)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -756,7 +757,7 @@ xmlFatalErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a non fatal parser error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar * val)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -781,7 +782,7 @@ xmlErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a fatal parser error, i.e. violating Well-Formedness constraints
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlNsErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg,
|
|
|
6dedca |
const xmlChar * info1, const xmlChar * info2,
|
|
|
6dedca |
@@ -810,7 +811,7 @@ xmlNsErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a namespace warning error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlNsWarn(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg,
|
|
|
6dedca |
const xmlChar * info1, const xmlChar * info2,
|
|
|
6dedca |
@@ -5510,7 +5511,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
|
|
6dedca |
skipped = SKIP_BLANKS;
|
|
|
6dedca |
if (skipped == 0) {
|
|
|
6dedca |
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
|
|
|
6dedca |
- "Space required after '%'\n");
|
|
|
6dedca |
+ "Space required after '%%'\n");
|
|
|
6dedca |
}
|
|
|
6dedca |
isParameter = 1;
|
|
|
6dedca |
}
|
|
|
6dedca |
diff --git a/parserInternals.c b/parserInternals.c
|
|
|
6dedca |
index 341d6a1..aac6420 100644
|
|
|
6dedca |
--- a/parserInternals.c
|
|
|
6dedca |
+++ b/parserInternals.c
|
|
|
6dedca |
@@ -169,7 +169,7 @@ __xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle an internal error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(2,0)
|
|
|
6dedca |
xmlErrInternal(xmlParserCtxtPtr ctxt, const char *msg, const xmlChar * str)
|
|
|
6dedca |
{
|
|
|
6dedca |
if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
|
|
|
6dedca |
@@ -197,7 +197,7 @@ xmlErrInternal(xmlParserCtxtPtr ctxt, const char *msg, const xmlChar * str)
|
|
|
6dedca |
*
|
|
|
6dedca |
* n encoding error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlErrEncodingInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, int val)
|
|
|
6dedca |
{
|
|
|
6dedca |
diff --git a/relaxng.c b/relaxng.c
|
|
|
6dedca |
index 370e314..b531081 100644
|
|
|
6dedca |
--- a/relaxng.c
|
|
|
6dedca |
+++ b/relaxng.c
|
|
|
6dedca |
@@ -507,7 +507,7 @@ xmlRngVErrMemory(xmlRelaxNGValidCtxtPtr ctxt, const char *extra)
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a Relax NG Parsing error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlRngPErr(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1, const xmlChar * str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -541,7 +541,7 @@ xmlRngPErr(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a Relax NG Validation error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlRngVErr(xmlRelaxNGValidCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1, const xmlChar * str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
diff --git a/schematron.c b/schematron.c
|
|
|
6dedca |
index 537b868..6f80c5c 100644
|
|
|
6dedca |
--- a/schematron.c
|
|
|
6dedca |
+++ b/schematron.c
|
|
|
6dedca |
@@ -243,7 +243,7 @@ xmlSchematronPErrMemory(xmlSchematronParserCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a parser error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlSchematronPErr(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1, const xmlChar * str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
diff --git a/testModule.c b/testModule.c
|
|
|
6dedca |
index e399f5c..77b7ba1 100644
|
|
|
6dedca |
--- a/testModule.c
|
|
|
6dedca |
+++ b/testModule.c
|
|
|
6dedca |
@@ -47,7 +47,7 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
|
|
|
6dedca |
|
|
|
6dedca |
/* build the module filename, and confirm the module exists */
|
|
|
6dedca |
xmlStrPrintf(filename, sizeof(filename),
|
|
|
6dedca |
- (const xmlChar*) "%s/testdso%s",
|
|
|
6dedca |
+ "%s/testdso%s",
|
|
|
6dedca |
(const xmlChar*)MODULE_PATH,
|
|
|
6dedca |
(const xmlChar*)LIBXML_MODULE_EXTENSION);
|
|
|
6dedca |
|
|
|
6dedca |
diff --git a/valid.c b/valid.c
|
|
|
6dedca |
index 6e53a76..657e3c8 100644
|
|
|
6dedca |
--- a/valid.c
|
|
|
6dedca |
+++ b/valid.c
|
|
|
6dedca |
@@ -93,7 +93,7 @@ xmlVErrMemory(xmlValidCtxtPtr ctxt, const char *extra)
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validation error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const char *extra)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -137,7 +137,7 @@ xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validation error, provide contextual informations
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlErrValidNode(xmlValidCtxtPtr ctxt,
|
|
|
6dedca |
xmlNodePtr node, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1,
|
|
|
6dedca |
@@ -180,7 +180,7 @@ xmlErrValidNode(xmlValidCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validation error, provide contextual informations
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlErrValidNodeNr(xmlValidCtxtPtr ctxt,
|
|
|
6dedca |
xmlNodePtr node, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1,
|
|
|
6dedca |
@@ -221,7 +221,7 @@ xmlErrValidNodeNr(xmlValidCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validation error, provide contextual information
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlErrValidWarning(xmlValidCtxtPtr ctxt,
|
|
|
6dedca |
xmlNodePtr node, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1,
|
|
|
6dedca |
diff --git a/xinclude.c b/xinclude.c
|
|
|
6dedca |
index ace005b..f56c7c4 100644
|
|
|
6dedca |
--- a/xinclude.c
|
|
|
6dedca |
+++ b/xinclude.c
|
|
|
6dedca |
@@ -124,7 +124,7 @@ xmlXIncludeErrMemory(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle an XInclude error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
const char *msg, const xmlChar *extra)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -146,7 +146,7 @@ xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Emit an XInclude warning.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlXIncludeWarn(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
const char *msg, const xmlChar *extra)
|
|
|
6dedca |
{
|
|
|
6dedca |
diff --git a/xmlIO.c b/xmlIO.c
|
|
|
6dedca |
index fc4e111..90a93e3 100644
|
|
|
6dedca |
--- a/xmlIO.c
|
|
|
6dedca |
+++ b/xmlIO.c
|
|
|
6dedca |
@@ -1590,7 +1590,7 @@ xmlCreateZMemBuff( int compression ) {
|
|
|
6dedca |
xmlFreeZMemBuff( buff );
|
|
|
6dedca |
buff = NULL;
|
|
|
6dedca |
xmlStrPrintf(msg, 500,
|
|
|
6dedca |
- (const xmlChar *) "xmlCreateZMemBuff: %s %d\n",
|
|
|
6dedca |
+ "xmlCreateZMemBuff: %s %d\n",
|
|
|
6dedca |
"Error initializing compression context. ZLIB error:",
|
|
|
6dedca |
z_err );
|
|
|
6dedca |
xmlIOErr(XML_IO_WRITE, (const char *) msg);
|
|
|
6dedca |
@@ -1658,7 +1658,7 @@ xmlZMemBuffExtend( xmlZMemBuffPtr buff, size_t ext_amt ) {
|
|
|
6dedca |
else {
|
|
|
6dedca |
xmlChar msg[500];
|
|
|
6dedca |
xmlStrPrintf(msg, 500,
|
|
|
6dedca |
- (const xmlChar *) "xmlZMemBuffExtend: %s %lu bytes.\n",
|
|
|
6dedca |
+ "xmlZMemBuffExtend: %s %lu bytes.\n",
|
|
|
6dedca |
"Allocation failure extending output buffer to",
|
|
|
6dedca |
new_size );
|
|
|
6dedca |
xmlIOErr(XML_IO_WRITE, (const char *) msg);
|
|
|
6dedca |
@@ -1704,7 +1704,7 @@ xmlZMemBuffAppend( xmlZMemBuffPtr buff, const char * src, int len ) {
|
|
|
6dedca |
if ( z_err != Z_OK ) {
|
|
|
6dedca |
xmlChar msg[500];
|
|
|
6dedca |
xmlStrPrintf(msg, 500,
|
|
|
6dedca |
- (const xmlChar *) "xmlZMemBuffAppend: %s %d %s - %d",
|
|
|
6dedca |
+ "xmlZMemBuffAppend: %s %d %s - %d",
|
|
|
6dedca |
"Compression error while appending",
|
|
|
6dedca |
len, "bytes to buffer. ZLIB error", z_err );
|
|
|
6dedca |
xmlIOErr(XML_IO_WRITE, (const char *) msg);
|
|
|
6dedca |
@@ -1777,7 +1777,7 @@ xmlZMemBuffGetContent( xmlZMemBuffPtr buff, char ** data_ref ) {
|
|
|
6dedca |
else {
|
|
|
6dedca |
xmlChar msg[500];
|
|
|
6dedca |
xmlStrPrintf(msg, 500,
|
|
|
6dedca |
- (const xmlChar *) "xmlZMemBuffGetContent: %s - %d\n",
|
|
|
6dedca |
+ "xmlZMemBuffGetContent: %s - %d\n",
|
|
|
6dedca |
"Error flushing zlib buffers. Error code", z_err );
|
|
|
6dedca |
xmlIOErr(XML_IO_WRITE, (const char *) msg);
|
|
|
6dedca |
}
|
|
|
6dedca |
@@ -1982,7 +1982,7 @@ xmlIOHTTPWrite( void * context, const char * buffer, int len ) {
|
|
|
6dedca |
if ( len < 0 ) {
|
|
|
6dedca |
xmlChar msg[500];
|
|
|
6dedca |
xmlStrPrintf(msg, 500,
|
|
|
6dedca |
- (const xmlChar *) "xmlIOHTTPWrite: %s\n%s '%s'.\n",
|
|
|
6dedca |
+ "xmlIOHTTPWrite: %s\n%s '%s'.\n",
|
|
|
6dedca |
"Error appending to internal buffer.",
|
|
|
6dedca |
"Error sending document to URI",
|
|
|
6dedca |
ctxt->uri );
|
|
|
6dedca |
@@ -2054,7 +2054,7 @@ xmlIOHTTPCloseWrite( void * context, const char * http_mthd ) {
|
|
|
6dedca |
if ( http_content == NULL ) {
|
|
|
6dedca |
xmlChar msg[500];
|
|
|
6dedca |
xmlStrPrintf(msg, 500,
|
|
|
6dedca |
- (const xmlChar *) "xmlIOHTTPCloseWrite: %s '%s' %s '%s'.\n",
|
|
|
6dedca |
+ "xmlIOHTTPCloseWrite: %s '%s' %s '%s'.\n",
|
|
|
6dedca |
"Error retrieving content.\nUnable to",
|
|
|
6dedca |
http_mthd, "data to URI", ctxt->uri );
|
|
|
6dedca |
xmlIOErr(XML_IO_WRITE, (const char *) msg);
|
|
|
6dedca |
@@ -2126,7 +2126,7 @@ xmlIOHTTPCloseWrite( void * context, const char * http_mthd ) {
|
|
|
6dedca |
else {
|
|
|
6dedca |
xmlChar msg[500];
|
|
|
6dedca |
xmlStrPrintf(msg, 500,
|
|
|
6dedca |
- (const xmlChar *) "xmlIOHTTPCloseWrite: HTTP '%s' of %d %s\n'%s' %s %d\n",
|
|
|
6dedca |
+ "xmlIOHTTPCloseWrite: HTTP '%s' of %d %s\n'%s' %s %d\n",
|
|
|
6dedca |
http_mthd, content_lgth,
|
|
|
6dedca |
"bytes to URI", ctxt->uri,
|
|
|
6dedca |
"failed. HTTP return code:", http_rtn );
|
|
|
6dedca |
diff --git a/xmllint.c b/xmllint.c
|
|
|
6dedca |
index 26d8db1..85552cf 100644
|
|
|
6dedca |
--- a/xmllint.c
|
|
|
6dedca |
+++ b/xmllint.c
|
|
|
6dedca |
@@ -449,7 +449,7 @@ startTimer(void)
|
|
|
6dedca |
* message about the timing performed; format is a printf
|
|
|
6dedca |
* type argument
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(1,2)
|
|
|
6dedca |
endTimer(const char *fmt, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
long msec;
|
|
|
6dedca |
@@ -485,7 +485,7 @@ startTimer(void)
|
|
|
6dedca |
{
|
|
|
6dedca |
begin = clock();
|
|
|
6dedca |
}
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(1,2)
|
|
|
6dedca |
endTimer(const char *fmt, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
long msec;
|
|
|
6dedca |
@@ -514,7 +514,7 @@ startTimer(void)
|
|
|
6dedca |
* Do nothing
|
|
|
6dedca |
*/
|
|
|
6dedca |
}
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(1,2)
|
|
|
6dedca |
endTimer(char *format, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
/*
|
|
|
6dedca |
@@ -634,7 +634,7 @@ xmlHTMLPrintFileContext(xmlParserInputPtr input) {
|
|
|
6dedca |
* Display and format an error messages, gives file, line, position and
|
|
|
6dedca |
* extra parameters.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
xmlHTMLError(void *ctx, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
|
|
6dedca |
@@ -671,7 +671,7 @@ xmlHTMLError(void *ctx, const char *msg, ...)
|
|
|
6dedca |
* Display and format a warning messages, gives file, line, position and
|
|
|
6dedca |
* extra parameters.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
xmlHTMLWarning(void *ctx, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
|
|
6dedca |
@@ -709,7 +709,7 @@ xmlHTMLWarning(void *ctx, const char *msg, ...)
|
|
|
6dedca |
* Display and format an validity error messages, gives file,
|
|
|
6dedca |
* line, position and extra parameters.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
xmlHTMLValidityError(void *ctx, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
|
|
6dedca |
@@ -746,7 +746,7 @@ xmlHTMLValidityError(void *ctx, const char *msg, ...)
|
|
|
6dedca |
* Display and format a validity warning messages, gives file, line,
|
|
|
6dedca |
* position and extra parameters.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
xmlHTMLValidityWarning(void *ctx, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
|
|
6dedca |
@@ -1410,7 +1410,7 @@ commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
|
|
|
6dedca |
* Display and format a warning messages, gives file, line, position and
|
|
|
6dedca |
* extra parameters.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
va_list args;
|
|
|
6dedca |
@@ -1433,7 +1433,7 @@ warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
|
|
6dedca |
* Display and format a error messages, gives file, line, position and
|
|
|
6dedca |
* extra parameters.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
va_list args;
|
|
|
6dedca |
@@ -1456,7 +1456,7 @@ errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
|
|
6dedca |
* Display and format a fatalError messages, gives file, line, position and
|
|
|
6dedca |
* extra parameters.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
fatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
va_list args;
|
|
|
6dedca |
diff --git a/xmlreader.c b/xmlreader.c
|
|
|
6dedca |
index 4fabaa9..d72129b 100644
|
|
|
6dedca |
--- a/xmlreader.c
|
|
|
6dedca |
+++ b/xmlreader.c
|
|
|
6dedca |
@@ -4036,13 +4036,19 @@ xmlTextReaderCurrentDoc(xmlTextReaderPtr reader) {
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
#ifdef LIBXML_SCHEMAS_ENABLED
|
|
|
6dedca |
-static char *xmlTextReaderBuildMessage(const char *msg, va_list ap);
|
|
|
6dedca |
+static char *xmlTextReaderBuildMessage(const char *msg, va_list ap) LIBXML_ATTR_FORMAT(1,0);
|
|
|
6dedca |
|
|
|
6dedca |
static void XMLCDECL
|
|
|
6dedca |
-xmlTextReaderValidityError(void *ctxt, const char *msg, ...);
|
|
|
6dedca |
+xmlTextReaderValidityError(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
|
|
6dedca |
|
|
|
6dedca |
static void XMLCDECL
|
|
|
6dedca |
-xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...);
|
|
|
6dedca |
+xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
|
|
6dedca |
+
|
|
|
6dedca |
+static void XMLCDECL
|
|
|
6dedca |
+xmlTextReaderValidityErrorRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
|
|
6dedca |
+
|
|
|
6dedca |
+static void XMLCDECL
|
|
|
6dedca |
+xmlTextReaderValidityWarningRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
|
|
6dedca |
|
|
|
6dedca |
static void XMLCDECL
|
|
|
6dedca |
xmlTextReaderValidityErrorRelay(void *ctx, const char *msg, ...)
|
|
|
6dedca |
@@ -4836,7 +4842,7 @@ xmlTextReaderStructuredError(void *ctxt, xmlErrorPtr error)
|
|
|
6dedca |
}
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
xmlTextReaderError(void *ctxt, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
va_list ap;
|
|
|
6dedca |
@@ -4849,7 +4855,7 @@ xmlTextReaderError(void *ctxt, const char *msg, ...)
|
|
|
6dedca |
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void XMLCDECL
|
|
|
6dedca |
+static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
|
|
|
6dedca |
xmlTextReaderWarning(void *ctxt, const char *msg, ...)
|
|
|
6dedca |
{
|
|
|
6dedca |
va_list ap;
|
|
|
6dedca |
diff --git a/xmlschemas.c b/xmlschemas.c
|
|
|
6dedca |
index 121533f..398cdd8 100644
|
|
|
6dedca |
--- a/xmlschemas.c
|
|
|
6dedca |
+++ b/xmlschemas.c
|
|
|
6dedca |
@@ -1085,7 +1085,7 @@ xmlSchemaGetUnionSimpleTypeMemberTypes(xmlSchemaTypePtr type);
|
|
|
6dedca |
static void
|
|
|
6dedca |
xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
const char *funcName,
|
|
|
6dedca |
- const char *message);
|
|
|
6dedca |
+ const char *message) LIBXML_ATTR_FORMAT(3,0);
|
|
|
6dedca |
static int
|
|
|
6dedca |
xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr ctxt,
|
|
|
6dedca |
xmlSchemaTypePtr type,
|
|
|
6dedca |
@@ -1889,7 +1889,7 @@ xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a parser error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1, const xmlChar * str2)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -1922,7 +1922,7 @@ xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a parser error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
|
|
|
6dedca |
xmlNodePtr child, int error,
|
|
|
6dedca |
const char *msg, const xmlChar * str1, const xmlChar * str2)
|
|
|
6dedca |
@@ -1951,7 +1951,7 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a parser error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(7,0)
|
|
|
6dedca |
xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
|
|
|
6dedca |
const xmlChar * strData1, const xmlChar * strData2,
|
|
|
6dedca |
const xmlChar * strData3, const char *msg, const xmlChar * str1,
|
|
|
6dedca |
@@ -2002,7 +2002,7 @@ xmlSchemaVErrMemory(xmlSchemaValidCtxtPtr ctxt,
|
|
|
6dedca |
extra);
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(2,0)
|
|
|
6dedca |
xmlSchemaPSimpleInternalErr(xmlNodePtr node,
|
|
|
6dedca |
const char *msg, const xmlChar *str)
|
|
|
6dedca |
{
|
|
|
6dedca |
@@ -2013,18 +2013,21 @@ xmlSchemaPSimpleInternalErr(xmlNodePtr node,
|
|
|
6dedca |
#define WXS_ERROR_TYPE_ERROR 1
|
|
|
6dedca |
#define WXS_ERROR_TYPE_WARNING 2
|
|
|
6dedca |
/**
|
|
|
6dedca |
- * xmlSchemaErr3:
|
|
|
6dedca |
+ * xmlSchemaErr4Line:
|
|
|
6dedca |
* @ctxt: the validation context
|
|
|
6dedca |
- * @node: the context node
|
|
|
6dedca |
+ * @errorLevel: the error level
|
|
|
6dedca |
* @error: the error code
|
|
|
6dedca |
+ * @node: the context node
|
|
|
6dedca |
+ * @line: the line number
|
|
|
6dedca |
* @msg: the error message
|
|
|
6dedca |
* @str1: extra data
|
|
|
6dedca |
* @str2: extra data
|
|
|
6dedca |
* @str3: extra data
|
|
|
6dedca |
+ * @str4: extra data
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validation error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(6,0)
|
|
|
6dedca |
xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
|
|
|
6dedca |
xmlErrorLevel errorLevel,
|
|
|
6dedca |
int error, xmlNodePtr node, int line, const char *msg,
|
|
|
6dedca |
@@ -2137,7 +2140,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a validation error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
int error, xmlNodePtr node, const char *msg,
|
|
|
6dedca |
const xmlChar *str1, const xmlChar *str2, const xmlChar *str3)
|
|
|
6dedca |
@@ -2146,7 +2149,7 @@ xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
msg, str1, str2, str3, NULL);
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
int error, xmlNodePtr node, const char *msg,
|
|
|
6dedca |
const xmlChar *str1, const xmlChar *str2,
|
|
|
6dedca |
@@ -2156,7 +2159,7 @@ xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
msg, str1, str2, str3, str4);
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(4,0)
|
|
|
6dedca |
xmlSchemaErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
int error, xmlNodePtr node, const char *msg,
|
|
|
6dedca |
const xmlChar *str1, const xmlChar *str2)
|
|
|
6dedca |
@@ -2179,7 +2182,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
|
|
6dedca |
/*
|
|
|
6dedca |
* Don't try to format other nodes than element and
|
|
|
6dedca |
* attribute nodes.
|
|
|
6dedca |
- * Play save and return an empty string.
|
|
|
6dedca |
+ * Play safe and return an empty string.
|
|
|
6dedca |
*/
|
|
|
6dedca |
*msg = xmlStrdup(BAD_CAST "");
|
|
|
6dedca |
return(*msg);
|
|
|
6dedca |
@@ -2260,7 +2263,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
|
|
|
6dedca |
return (*msg);
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
const char *funcName,
|
|
|
6dedca |
const char *message,
|
|
|
6dedca |
@@ -2271,24 +2274,21 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
|
|
|
6dedca |
if (actxt == NULL)
|
|
|
6dedca |
return;
|
|
|
6dedca |
- msg = xmlStrdup(BAD_CAST "Internal error: ");
|
|
|
6dedca |
- msg = xmlStrcat(msg, BAD_CAST funcName);
|
|
|
6dedca |
- msg = xmlStrcat(msg, BAD_CAST ", ");
|
|
|
6dedca |
+ msg = xmlStrdup(BAD_CAST "Internal error: %s, ");
|
|
|
6dedca |
msg = xmlStrcat(msg, BAD_CAST message);
|
|
|
6dedca |
msg = xmlStrcat(msg, BAD_CAST ".\n");
|
|
|
6dedca |
|
|
|
6dedca |
if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR)
|
|
|
6dedca |
- xmlSchemaErr(actxt, XML_SCHEMAV_INTERNAL, NULL,
|
|
|
6dedca |
- (const char *) msg, str1, str2);
|
|
|
6dedca |
-
|
|
|
6dedca |
+ xmlSchemaErr3(actxt, XML_SCHEMAV_INTERNAL, NULL,
|
|
|
6dedca |
+ (const char *) msg, (const xmlChar *) funcName, str1, str2);
|
|
|
6dedca |
else if (actxt->type == XML_SCHEMA_CTXT_PARSER)
|
|
|
6dedca |
- xmlSchemaErr(actxt, XML_SCHEMAP_INTERNAL, NULL,
|
|
|
6dedca |
- (const char *) msg, str1, str2);
|
|
|
6dedca |
+ xmlSchemaErr3(actxt, XML_SCHEMAP_INTERNAL, NULL,
|
|
|
6dedca |
+ (const char *) msg, (const xmlChar *) funcName, str1, str2);
|
|
|
6dedca |
|
|
|
6dedca |
FREE_AND_NULL(msg)
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
const char *funcName,
|
|
|
6dedca |
const char *message)
|
|
|
6dedca |
@@ -2297,7 +2297,7 @@ xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
#if 0
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlSchemaPInternalErr(xmlSchemaParserCtxtPtr pctxt,
|
|
|
6dedca |
const char *funcName,
|
|
|
6dedca |
const char *message,
|
|
|
6dedca |
@@ -2309,7 +2309,7 @@ xmlSchemaPInternalErr(xmlSchemaParserCtxtPtr pctxt,
|
|
|
6dedca |
}
|
|
|
6dedca |
#endif
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlNodePtr node,
|
|
|
6dedca |
@@ -2334,7 +2334,7 @@ xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
FREE_AND_NULL(msg)
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlNodePtr node,
|
|
|
6dedca |
@@ -2349,7 +2349,7 @@ xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
|
|
|
6dedca |
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlNodePtr node,
|
|
|
6dedca |
@@ -2374,7 +2374,7 @@ xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
|
|
|
6dedca |
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlSchemaPSVIIDCNodePtr idcNode,
|
|
|
6dedca |
@@ -2523,7 +2523,7 @@ xmlSchemaIllegalAttrErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
FREE_AND_NULL(msg)
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlNodePtr node,
|
|
|
6dedca |
@@ -2623,7 +2623,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
xmlFree(msg);
|
|
|
6dedca |
}
|
|
|
6dedca |
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(8,0)
|
|
|
6dedca |
xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlNodePtr node,
|
|
|
6dedca |
@@ -2914,7 +2914,7 @@ xmlSchemaPIllegalAttrErr(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Reports an error during parsing.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlSchemaBasicItemPtr item,
|
|
|
6dedca |
@@ -2950,7 +2950,7 @@ xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Reports an error during parsing.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(5,0)
|
|
|
6dedca |
xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlSchemaBasicItemPtr item,
|
|
|
6dedca |
@@ -2975,7 +2975,7 @@ xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Reports an attribute use error during parsing.
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(6,0)
|
|
|
6dedca |
xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlNodePtr node,
|
|
|
6dedca |
@@ -3097,7 +3097,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
* Reports a simple type validation error.
|
|
|
6dedca |
* TODO: Should this report the value of an element as well?
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(8,0)
|
|
|
6dedca |
xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
|
|
|
6dedca |
xmlParserErrors error,
|
|
|
6dedca |
xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED,
|
|
|
6dedca |
diff --git a/xmlstring.c b/xmlstring.c
|
|
|
6dedca |
index d465c23..c66eef3 100644
|
|
|
6dedca |
--- a/xmlstring.c
|
|
|
6dedca |
+++ b/xmlstring.c
|
|
|
6dedca |
@@ -545,7 +545,7 @@ xmlStrcat(xmlChar *cur, const xmlChar *add) {
|
|
|
6dedca |
* Returns the number of characters written to @buf or -1 if an error occurs.
|
|
|
6dedca |
*/
|
|
|
6dedca |
int XMLCDECL
|
|
|
6dedca |
-xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) {
|
|
|
6dedca |
+xmlStrPrintf(xmlChar *buf, int len, const char *msg, ...) {
|
|
|
6dedca |
va_list args;
|
|
|
6dedca |
int ret;
|
|
|
6dedca |
|
|
|
6dedca |
@@ -573,7 +573,7 @@ xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) {
|
|
|
6dedca |
* Returns the number of characters written to @buf or -1 if an error occurs.
|
|
|
6dedca |
*/
|
|
|
6dedca |
int
|
|
|
6dedca |
-xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) {
|
|
|
6dedca |
+xmlStrVPrintf(xmlChar *buf, int len, const char *msg, va_list ap) {
|
|
|
6dedca |
int ret;
|
|
|
6dedca |
|
|
|
6dedca |
if((buf == NULL) || (msg == NULL)) {
|
|
|
6dedca |
diff --git a/xmlwriter.c b/xmlwriter.c
|
|
|
6dedca |
index d3f29f8..92c4bb2 100644
|
|
|
6dedca |
--- a/xmlwriter.c
|
|
|
6dedca |
+++ b/xmlwriter.c
|
|
|
6dedca |
@@ -109,7 +109,7 @@ static int xmlTextWriterWriteDocCallback(void *context,
|
|
|
6dedca |
const xmlChar * str, int len);
|
|
|
6dedca |
static int xmlTextWriterCloseDocCallback(void *context);
|
|
|
6dedca |
|
|
|
6dedca |
-static xmlChar *xmlTextWriterVSprintf(const char *format, va_list argptr);
|
|
|
6dedca |
+static xmlChar *xmlTextWriterVSprintf(const char *format, va_list argptr) LIBXML_ATTR_FORMAT(1,0);
|
|
|
6dedca |
static int xmlOutputBufferWriteBase64(xmlOutputBufferPtr out, int len,
|
|
|
6dedca |
const unsigned char *data);
|
|
|
6dedca |
static void xmlTextWriterStartDocumentCallback(void *ctx);
|
|
|
6dedca |
@@ -149,7 +149,7 @@ xmlWriterErrMsg(xmlTextWriterPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a writer error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlWriterErrMsgInt(xmlTextWriterPtr ctxt, xmlParserErrors error,
|
|
|
6dedca |
const char *msg, int val)
|
|
|
6dedca |
{
|
|
|
6dedca |
diff --git a/xpath.c b/xpath.c
|
|
|
6dedca |
index 97410e7..6ddf491 100644
|
|
|
6dedca |
--- a/xpath.c
|
|
|
6dedca |
+++ b/xpath.c
|
|
|
6dedca |
@@ -348,7 +348,7 @@ xmlXPathErrMemory(xmlXPathContextPtr ctxt, const char *extra)
|
|
|
6dedca |
xmlChar buf[200];
|
|
|
6dedca |
|
|
|
6dedca |
xmlStrPrintf(buf, 200,
|
|
|
6dedca |
- BAD_CAST "Memory allocation failed : %s\n",
|
|
|
6dedca |
+ "Memory allocation failed : %s\n",
|
|
|
6dedca |
extra);
|
|
|
6dedca |
ctxt->lastError.message = (char *) xmlStrdup(buf);
|
|
|
6dedca |
} else {
|
|
|
6dedca |
diff --git a/xpointer.c b/xpointer.c
|
|
|
6dedca |
index 46f11e8..1a48812 100644
|
|
|
6dedca |
--- a/xpointer.c
|
|
|
6dedca |
+++ b/xpointer.c
|
|
|
6dedca |
@@ -85,7 +85,7 @@ xmlXPtrErrMemory(const char *extra)
|
|
|
6dedca |
*
|
|
|
6dedca |
* Handle a redefinition of attribute error
|
|
|
6dedca |
*/
|
|
|
6dedca |
-static void
|
|
|
6dedca |
+static void LIBXML_ATTR_FORMAT(3,0)
|
|
|
6dedca |
xmlXPtrErr(xmlXPathParserContextPtr ctxt, int error,
|
|
|
6dedca |
const char * msg, const xmlChar *extra)
|
|
|
6dedca |
{
|
|
|
6dedca |
--
|
|
|
6dedca |
2.5.5
|
|
|
6dedca |
|