Ticket #63105: move-pragmas-outside-functions.diff

File move-pragmas-outside-functions.diff, 1.2 KB (added by evanmiller (Evan Miller), 3 years ago)

Patch to move pragmas outside of function bodies, instead of deleting them (submitted upstream also)

  • base/scommon.h

    old new  
    115115 * This allows localized disabling of the "array bounds" compiler
    116116 * warning for this one specific case.
    117117 */
    118 static inline void
    119 stream_cursor_read_init(stream_cursor_read *r, const byte *buf, size_t length)
    120 {
    121118#ifdef __GNUC__
    122119#  pragma GCC diagnostic push
    123120#  pragma GCC diagnostic ignored "-Warray-bounds"
    124121#endif
     122static inline void
     123stream_cursor_read_init(stream_cursor_read *r, const byte *buf, size_t length)
     124{
    125125    /* starting pos for pointer is always one position back */
    126126    r->ptr = buf - 1;
    127127    r->limit = r->ptr + length;
    128 #ifdef __GNUC__
    129 #  pragma GCC diagnostic pop
    130 #endif
    131128}
    132129
    133130static inline void
    134131stream_cursor_write_init(stream_cursor_write *w, const byte *buf, size_t length)
    135132{
    136 #ifdef __GNUC__
    137 #  pragma GCC diagnostic push
    138 #  pragma GCC diagnostic ignored "-Warray-bounds"
    139 #endif
    140133    /* starting pos for pointer is always one position back */
    141134    w->ptr = (byte *)buf - 1;
    142135    w->limit = (byte *)w->ptr + length;
     136}
    143137#ifdef __GNUC__
    144138#  pragma GCC diagnostic pop
    145139#endif
    146 }
    147140
    148141/*
    149142 * Define the prototype for the procedures known to both the generic