NetBSD: build failure

greed 4.4 does not build on NetBSD, due to -Werror.

greed.c: In function 'main':
greed.c:381:74: error: array subscript has type 'char' [-Werror=char-subscripts]
  381 |                                                                  tolower(*cp)) -
      |                                                                          ^

POSIX specifies that ctype(3) functions only should be passed EOF or an unsigned char value, and NetBSD is especially picky about this, see https://man.netbsd.org/ctype.3

The standard workaround is to cast the argument to unsigned char (after making sure it is in the correct range).

Assignee Loading
Time tracking Loading