diff options
author | Peter Dyballa <Peter_Dyballa@Web.DE> | 2021-08-18 13:16:32 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2021-08-19 07:06:21 +0100 |
commit | a9ce865035e798c30d0619399b3bdc69a4cc5943 (patch) | |
tree | 2c8f41c450505b27eb99278efdead3d40290d71d | |
parent | d99c00bc06d2476835b1e024d595f1861a2e88af (diff) | |
download | ghostpdl-a9ce865035e798c30d0619399b3bdc69a4cc5943.tar.gz |
Bug 703948: move pragmas out of function body
Older gcc versions give the error:
"#pragma GCC diagnostic not allowed inside functions",
-rw-r--r-- | base/scommon.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/base/scommon.h b/base/scommon.h index d8bdda8cc..542b960ca 100644 --- a/base/scommon.h +++ b/base/scommon.h @@ -115,35 +115,28 @@ typedef union stream_cursor_s { * This allows localized disabling of the "array bounds" compiler * warning for this one specific case. */ -static inline void -stream_cursor_read_init(stream_cursor_read *r, const byte *buf, size_t length) -{ #ifdef __GNUC__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Warray-bounds" #endif +static inline void +stream_cursor_read_init(stream_cursor_read *r, const byte *buf, size_t length) +{ /* starting pos for pointer is always one position back */ r->ptr = buf - 1; r->limit = r->ptr + length; -#ifdef __GNUC__ -# pragma GCC diagnostic pop -#endif } static inline void stream_cursor_write_init(stream_cursor_write *w, const byte *buf, size_t length) { -#ifdef __GNUC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Warray-bounds" -#endif /* starting pos for pointer is always one position back */ w->ptr = (byte *)buf - 1; w->limit = (byte *)w->ptr + length; +} #ifdef __GNUC__ # pragma GCC diagnostic pop #endif -} /* * Define the prototype for the procedures known to both the generic |