In article <20200921083148.GA17688@quantz>, Patrick Welche <pr...@cam.ac.uk> wrote: >Since gcc9, essentially every ctype using piece of software fails with > > error: array subscript has type 'char' [-Werror=char-subscripts] > >which prompts a style question: cast every argument of every call to >a ctype function in every piece of software to (unsigned char), or >-Wno-error=char-subscripts], or something else?
cast to unsigned char. The ctype functions have undefined behavior for negative values other than -1. The code is buggy. christos