Commit 8e636ea6806ab5d1f1d05bafd0a192dad06d42b6

Authored by Jay Berkenbilt
1 parent e8ddac89

Protect gcc diagnostic pragmas with gcc version

Versions prior to 4.6 didn't allow gcc diagnostic pragmas with push
and pop and to appear anywhere in the file.  Just let the warning be
there for those versions.
Showing 1 changed file with 4 additions and 0 deletions
libqpdf/Pl_Flate.cc
@@ -77,8 +77,10 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush) @@ -77,8 +77,10 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush)
77 // deflateInit and inflateInit are macros that use old-style 77 // deflateInit and inflateInit are macros that use old-style
78 // casts. 78 // casts.
79 #ifdef __GNUC__ 79 #ifdef __GNUC__
  80 +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
80 # pragma GCC diagnostic push 81 # pragma GCC diagnostic push
81 # pragma GCC diagnostic ignored "-Wold-style-cast" 82 # pragma GCC diagnostic ignored "-Wold-style-cast"
  83 +# endif
82 #endif 84 #endif
83 if (this->action == a_deflate) 85 if (this->action == a_deflate)
84 { 86 {
@@ -89,7 +91,9 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush) @@ -89,7 +91,9 @@ Pl_Flate::handleData(unsigned char* data, int len, int flush)
89 err = inflateInit(&zstream); 91 err = inflateInit(&zstream);
90 } 92 }
91 #ifdef __GNUC__ 93 #ifdef __GNUC__
  94 +# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
92 # pragma GCC diagnostic pop 95 # pragma GCC diagnostic pop
  96 +# endif
93 #endif 97 #endif
94 98
95 checkError("Init", err); 99 checkError("Init", err);