From: Ilya Leoshkevich Date: Tue, 21 Jul 2020 11:15:07 +0000 (+0200) Subject: zng_tr_tally_lit: disable -Wtype-limits X-Git-Tag: 1.9.9-b1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24c442c606d9121da64b25693c9bb1a898b3553f;p=thirdparty%2Fzlib-ng.git zng_tr_tally_lit: disable -Wtype-limits Some gcc versions complain that parameter c is always less than MAX_MATCH-MIN_MATCH, and therefore the assertion that checks for this is useless, but in reality some day MIN_MATCH and MAX_MATCH can change. So disable the warning around the assertion. --- diff --git a/deflate_p.h b/deflate_p.h index 09746a75..c956f7f4 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -33,7 +33,10 @@ static inline int zng_tr_tally_lit(deflate_state *s, unsigned char c) { s->sym_buf[s->sym_next++] = c; s->dyn_ltree[c].Freq++; Tracevv((stderr, "%c", c)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtype-limits" Assert(c <= (MAX_MATCH-MIN_MATCH), "zng_tr_tally: bad literal"); +#pragma GCC diagnostic pop return (s->sym_next == s->sym_end); }