Ticket #63105: move-pragmas-outside-functions.diff
File move-pragmas-outside-functions.diff, 1.2 KB (added by evanmiller (Evan Miller), 3 years ago) |
---|
-
base/scommon.h
old new 115 115 * This allows localized disabling of the "array bounds" compiler 116 116 * warning for this one specific case. 117 117 */ 118 static inline void119 stream_cursor_read_init(stream_cursor_read *r, const byte *buf, size_t length)120 {121 118 #ifdef __GNUC__ 122 119 # pragma GCC diagnostic push 123 120 # pragma GCC diagnostic ignored "-Warray-bounds" 124 121 #endif 122 static inline void 123 stream_cursor_read_init(stream_cursor_read *r, const byte *buf, size_t length) 124 { 125 125 /* starting pos for pointer is always one position back */ 126 126 r->ptr = buf - 1; 127 127 r->limit = r->ptr + length; 128 #ifdef __GNUC__129 # pragma GCC diagnostic pop130 #endif131 128 } 132 129 133 130 static inline void 134 131 stream_cursor_write_init(stream_cursor_write *w, const byte *buf, size_t length) 135 132 { 136 #ifdef __GNUC__137 # pragma GCC diagnostic push138 # pragma GCC diagnostic ignored "-Warray-bounds"139 #endif140 133 /* starting pos for pointer is always one position back */ 141 134 w->ptr = (byte *)buf - 1; 142 135 w->limit = (byte *)w->ptr + length; 136 } 143 137 #ifdef __GNUC__ 144 138 # pragma GCC diagnostic pop 145 139 #endif 146 }147 140 148 141 /* 149 142 * Define the prototype for the procedures known to both the generic