summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-28 09:21:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-28 09:02:50 +0100
commitc4d760b9edf0399955d30a0dfbe5f7b1b1ed37cb (patch)
tree3f072b8348ddfc03b6571f110318c3081b7e0b00
parentd73871584f646cbf02467871fcfc7039ad985ff3 (diff)
add some __attribute__ ((format
found by -Wsuggest-attribute=format Change-Id: Ib4430805ddebf4d90e07a3f9d06fd6d832c244a4 Reviewed-on: https://gerrit.libreoffice.org/81582 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/vcl/opengl/OpenGLHelper.hxx3
-rw-r--r--soltools/mkdepend/main.c9
-rw-r--r--unoxml/source/xpath/xpathapi.cxx3
3 files changed, 15 insertions, 0 deletions
diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx
index 861af021a383..4f365c2e44ff 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -92,6 +92,9 @@ public:
* Insert a glDebugMessage into the queue - helpful for debugging
* with apitrace to annotate the output and correlate it with code.
*/
+#if defined __GNUC__
+ __attribute__ ((format (printf, 2, 3)))
+#endif
static void debugMsgPrint(const int nType, const char *pFormat, ...);
static void debugMsgStream(std::ostringstream const &pStream);
static void debugMsgStreamWarn(std::ostringstream const &pStream);
diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 7ee27c439f7d..b8b84b453476 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -654,6 +654,9 @@ void redirect(char *makefile)
fatalerr("cannot open \"%s\"\n", makefile ? makefile : "<NULL>");
}
+#if defined __GNUC__
+__attribute__ ((format (printf, 1, 2)))
+#endif
void fatalerr(char *msg, ...)
{
va_list args;
@@ -664,6 +667,9 @@ void fatalerr(char *msg, ...)
exit (1);
}
+#if defined __GNUC__
+__attribute__ ((format (printf, 1, 2)))
+#endif
void warning(char const *msg, ...)
{
#ifdef DEBUG_MKDEPEND
@@ -677,6 +683,9 @@ void warning(char const *msg, ...)
#endif /* DEBUG_MKDEPEND */
}
+#if defined __GNUC__
+__attribute__ ((format (printf, 1, 2)))
+#endif
void warning1(char const *msg, ...)
{
#ifdef DEBUG_MKDEPEND
diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx
index 491be8cab0b7..5d3e6d8c6189 100644
--- a/unoxml/source/xpath/xpathapi.cxx
+++ b/unoxml/source/xpath/xpathapi.cxx
@@ -261,6 +261,9 @@ namespace XPath
extern "C" {
+#if defined __GNUC__
+ __attribute__ ((format (printf, 2, 3)))
+#endif
static void generic_error_func(void *, const char *format, ...)
{
char str[1000];