[Libreoffice-commits] core.git: include/vcl soltools/mkdepend unoxml/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 28 08:03:47 UTC 2019


 include/vcl/opengl/OpenGLHelper.hxx |    3 +++
 soltools/mkdepend/main.c            |    9 +++++++++
 unoxml/source/xpath/xpathapi.cxx    |    3 +++
 3 files changed, 15 insertions(+)

New commits:
commit c4d760b9edf0399955d30a0dfbe5f7b1b1ed37cb
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Oct 28 09:21:35 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 28 09:02:50 2019 +0100

    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 at collabora.co.uk>

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];


More information about the Libreoffice-commits mailing list