https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116432

            Bug ID: 116432
           Summary: Problem with warming Wtype-limits
           Product: gcc
           Version: 11.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lukaszcz18 at wp dot pl
  Target Milestone: ---

I would like to ask what is written wrong here.

#ifndef ARRAY_SIZE
#       define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif

static const lzma_filter_decoder decoders[] = {
...
}


filter_decoder.c: In function 'decoder_find':
filter_decoder.c:145:30: warning: comparison of unsigned expression in '< 0' is
always false [-Wtype-limits]
  145 |         for (size_t i = 0; i < ARRAY_SIZE(decoders); ++i)
      |                              ^
filter_encoder.c: In function 'encoder_find':
filter_encoder.c:188:30: warning: comparison of unsigned expression in '< 0' is
always false [-Wtype-limits]
  188 |         for (size_t i = 0; i < ARRAY_SIZE(encoders); ++i)
      |                              ^
string_conversion.c: In function 'parse_filter':
string_conversion.c:815:30: warning: comparison of unsigned expression in '< 0'
is always false [-Wtype-limits]
  815 |         for (size_t i = 0; i < ARRAY_SIZE(filter_name_map); ++i) {
      |                              ^
string_conversion.c: In function 'lzma_str_list_filters':
string_conversion.c:1255:30: warning: comparison of unsigned expression in '<
0' is always false [-Wtype-limits]
 1255 |         for (size_t i = 0; i < ARRAY_SIZE(filter_name_map); ++i) {
      |

Reply via email to