[poppler] qt5/src qt6/src

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 24 22:33:14 UTC 2021


 qt5/src/poppler-qiodeviceoutstream-private.h |    2 +-
 qt5/src/poppler-qiodeviceoutstream.cc        |    2 ++
 qt6/src/poppler-qiodeviceoutstream-private.h |    2 +-
 qt6/src/poppler-qiodeviceoutstream.cc        |    2 ++
 4 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 70980eaf611c21a5f12a7edbe332e223f3b874f1
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Wed Nov 24 16:53:29 2021 +0100

    poppler-qiodeviceoutstream: add printf format attribute for GCC
    
    Solves
    ```
    /home/even/poppler/qt5/src/poppler-qiodeviceoutstream.cc: In function ‘int Poppler::poppler_vasprintf(char**, const char*, __va_list_tag*)’:
    /home/even/poppler/qt5/src/poppler-qiodeviceoutstream.cc:49:62: warning: function ‘int Poppler::poppler_vasprintf(char**, const char*, __va_list_tag*)’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
       49 |     const size_t size = vsnprintf(nullptr, 0, format, ap_copy) + 1;
          |                                                              ^
    ```

diff --git a/qt5/src/poppler-qiodeviceoutstream-private.h b/qt5/src/poppler-qiodeviceoutstream-private.h
index b1b5101a..bc8dd02a 100644
--- a/qt5/src/poppler-qiodeviceoutstream-private.h
+++ b/qt5/src/poppler-qiodeviceoutstream-private.h
@@ -37,7 +37,7 @@ public:
     void close() override;
     Goffset getPos() override;
     void put(char c) override;
-    void printf(const char *format, ...) override;
+    void printf(const char *format, ...) override GCC_PRINTF_FORMAT(2, 3);
 
 private:
     QIODevice *m_device;
diff --git a/qt5/src/poppler-qiodeviceoutstream.cc b/qt5/src/poppler-qiodeviceoutstream.cc
index 13941914..4c7e8eff 100644
--- a/qt5/src/poppler-qiodeviceoutstream.cc
+++ b/qt5/src/poppler-qiodeviceoutstream.cc
@@ -42,6 +42,8 @@ void QIODeviceOutStream::put(char c)
     m_device->putChar(c);
 }
 
+static int poppler_vasprintf(char **buf_ptr, const char *format, va_list ap) GCC_PRINTF_FORMAT(2, 0);
+
 static int poppler_vasprintf(char **buf_ptr, const char *format, va_list ap)
 {
     va_list ap_copy;
diff --git a/qt6/src/poppler-qiodeviceoutstream-private.h b/qt6/src/poppler-qiodeviceoutstream-private.h
index 9f407d17..4f7b0f85 100644
--- a/qt6/src/poppler-qiodeviceoutstream-private.h
+++ b/qt6/src/poppler-qiodeviceoutstream-private.h
@@ -37,7 +37,7 @@ public:
     void close() override;
     Goffset getPos() override;
     void put(char c) override;
-    void printf(const char *format, ...) override;
+    void printf(const char *format, ...) override GCC_PRINTF_FORMAT(2, 3);
 
 private:
     QIODevice *m_device;
diff --git a/qt6/src/poppler-qiodeviceoutstream.cc b/qt6/src/poppler-qiodeviceoutstream.cc
index 171f7399..75d36128 100644
--- a/qt6/src/poppler-qiodeviceoutstream.cc
+++ b/qt6/src/poppler-qiodeviceoutstream.cc
@@ -42,6 +42,8 @@ void QIODeviceOutStream::put(char c)
     m_device->putChar(c);
 }
 
+static int poppler_vasprintf(char **buf_ptr, const char *format, va_list ap) GCC_PRINTF_FORMAT(2, 0);
+
 static int poppler_vasprintf(char **buf_ptr, const char *format, va_list ap)
 {
     va_list ap_copy;


More information about the poppler mailing list