diff --git a/zlib-format.patch b/zlib-format.patch new file mode 100644 index 0000000..5feca5d --- /dev/null +++ b/zlib-format.patch @@ -0,0 +1,20 @@ +From: meissner@suse.de +Subject: supply format arguments to gzprintf(). + +Index: zlib.h +=================================================================== +--- zlib.h.orig ++++ zlib.h +@@ -1463,7 +1463,11 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((vo + is returned, and the error state is set to Z_STREAM_ERROR. + */ + +-ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); ++ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)) ++#ifdef __GNUC__ ++ __attribute__((__format__(__printf__,2,3))) ++#endif ++; + /* + Converts, formats, and writes the arguments to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of diff --git a/zlib.changes b/zlib.changes index bf4d837..a65741e 100644 --- a/zlib.changes +++ b/zlib.changes @@ -17,7 +17,6 @@ Mon Jan 2 09:08:50 UTC 2017 - mpluskal@suse.com * zlib-bnc1003579.patch * zlib-bnc1003580.patch * zlib-bnc1013882.patch - * zlib-format.patch - Drop zlib-1.2.7-improve-longest_match-performance.patch * not accepted by upstream for two releases * rebasing no longer possible diff --git a/zlib.spec b/zlib.spec index 4550fc8..8a359ac 100644 --- a/zlib.spec +++ b/zlib.spec @@ -28,6 +28,8 @@ Source0: http://zlib.net/zlib-%{version}.tar.gz Source1: LICENSE Source2: baselibs.conf Source3: zlib-rpmlintrc +#PATCH-FIX-SUSE: compiler check of varguments passed to gzprintf +Patch1: zlib-format.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -109,6 +111,7 @@ developing applications which use minizip. %prep %setup -q +%patch1 %build export LDFLAGS="-Wl,-z,relro,-z,now"