warning: array subscript is of type 'char' on NetBSD 9
main
produces warnings on NetBSD 9.1 with Clang 10.0.1:
url.c:240:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (isalpha(ch)) {
^~~~~~~~~~~
/usr/include/sys/ctype_inline.h:49:44: note: expanded from macro 'isalpha'
#define isalpha(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_A))
^~~~
url.c:247:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (isalpha(ch)) {
^~~~~~~~~~~
/usr/include/sys/ctype_inline.h:49:44: note: expanded from macro 'isalpha'
#define isalpha(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_A))
^~~~
url.c:291:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (IS_USERINFO_CHAR(ch) || ch == '[' || ch == ']') {
^~~~~~~~~~~~~~~~~~~~
url.c:194:3: note: expanded from macro 'IS_USERINFO_CHAR'
(isalnum(c) || IS_MARK(c) || (c) == '%' || (c) == ';' || (c) == ':' || \
^~~~~~~~~~
/usr/include/sys/ctype_inline.h:48:44: note: expanded from macro 'isalnum'
#define isalnum(c) ((int)((_ctype_tab_ + 1)[(c)] & (_CTYPE_A|_CTYPE_D)))
^~~~
url.c:377:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (IS_USERINFO_CHAR(ch)) {
^~~~~~~~~~~~~~~~~~~~
url.c:194:3: note: expanded from macro 'IS_USERINFO_CHAR'
(isalnum(c) || IS_MARK(c) || (c) == '%' || (c) == ';' || (c) == ':' || \
^~~~~~~~~~
/usr/include/sys/ctype_inline.h:48:44: note: expanded from macro 'isalnum'
#define isalnum(c) ((int)((_ctype_tab_ + 1)[(c)] & (_CTYPE_A|_CTYPE_D)))
^~~~
url.c:387:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (IS_HOST_CHAR(ch)) {
^~~~~~~~~~~~~~~~
url.c:199:26: note: expanded from macro 'IS_HOST_CHAR'
#define IS_HOST_CHAR(c) (isalnum(c) || (c) == '.' || (c) == '-')
^~~~~~~~~~
/usr/include/sys/ctype_inline.h:48:44: note: expanded from macro 'isalnum'
#define isalnum(c) ((int)((_ctype_tab_ + 1)[(c)] & (_CTYPE_A|_CTYPE_D)))
^~~~
url.c:394:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (IS_HOST_CHAR(ch)) {
^~~~~~~~~~~~~~~~
url.c:199:26: note: expanded from macro 'IS_HOST_CHAR'
#define IS_HOST_CHAR(c) (isalnum(c) || (c) == '.' || (c) == '-')
^~~~~~~~~~
/usr/include/sys/ctype_inline.h:48:44: note: expanded from macro 'isalnum'
#define isalnum(c) ((int)((_ctype_tab_ + 1)[(c)] & (_CTYPE_A|_CTYPE_D)))
^~~~
url.c:413:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (isxdigit(ch) || ch == ':' || ch == '.') {
^~~~~~~~~~~~
/usr/include/sys/ctype_inline.h:58:45: note: expanded from macro 'isxdigit'
#define isxdigit(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_X))
^~~~
url.c:430:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (isalnum(ch) || ch == '%' || ch == '.' || ch == '-' ||
^~~~~~~~~~~
/usr/include/sys/ctype_inline.h:48:44: note: expanded from macro 'isalnum'
#define isalnum(c) ((int)((_ctype_tab_ + 1)[(c)] & (_CTYPE_A|_CTYPE_D)))
^~~~
url.c:439:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (isdigit(ch)) {
^~~~~~~~~~~
/usr/include/sys/ctype_inline.h:51:44: note: expanded from macro 'isdigit'
#define isdigit(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_D))
^~~~
9 warnings generated.
netmgr/http.c:2694:20: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (MATCH('_') || MATCH_ALPHA()) {
^~~~~~~~~~~~~
netmgr/http.c:2588:24: note: expanded from macro 'MATCH_ALPHA'
#define MATCH_ALPHA() isalpha(st->str[0])
^~~~~~~~~~~~~~~~~~~
/usr/include/sys/ctype_inline.h:49:44: note: expanded from macro 'isalpha'
#define isalpha(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_A))
^~~~
netmgr/http.c:2701:23: warning: array subscript is of type 'char' [-Wchar-subscripts]
while (MATCH('_') || MATCH_ALNUM()) {
^~~~~~~~~~~~~
netmgr/http.c:2589:24: note: expanded from macro 'MATCH_ALNUM'
#define MATCH_ALNUM() isalnum(st->str[0])
^~~~~~~~~~~~~~~~~~~
/usr/include/sys/ctype_inline.h:48:44: note: expanded from macro 'isalnum'
#define isalnum(c) ((int)((_ctype_tab_ + 1)[(c)] & (_CTYPE_A|_CTYPE_D)))
^~~~
netmgr/http.c:2735:6: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (MATCH_ALNUM() || MATCH('_') || MATCH('.') || MATCH('-') ||
^~~~~~~~~~~~~
netmgr/http.c:2589:24: note: expanded from macro 'MATCH_ALNUM'
#define MATCH_ALNUM() isalnum(st->str[0])
^~~~~~~~~~~~~~~~~~~
/usr/include/sys/ctype_inline.h:48:44: note: expanded from macro 'isalnum'
#define isalnum(c) ((int)((_ctype_tab_ + 1)[(c)] & (_CTYPE_A|_CTYPE_D)))
^~~~
netmgr/http.c:2751:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (!MATCH_XDIGIT()) {
^~~~~~~~~~~~~~
netmgr/http.c:2590:24: note: expanded from macro 'MATCH_XDIGIT'
#define MATCH_XDIGIT() isxdigit(st->str[0])
^~~~~~~~~~~~~~~~~~~~
/usr/include/sys/ctype_inline.h:58:45: note: expanded from macro 'isxdigit'
#define isxdigit(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_X))
^~~~
netmgr/http.c:2756:7: warning: array subscript is of type 'char' [-Wchar-subscripts]
if (!MATCH_XDIGIT()) {
^~~~~~~~~~~~~~
netmgr/http.c:2590:24: note: expanded from macro 'MATCH_XDIGIT'
#define MATCH_XDIGIT() isxdigit(st->str[0])
^~~~~~~~~~~~~~~~~~~~
/usr/include/sys/ctype_inline.h:58:45: note: expanded from macro 'isxdigit'
#define isxdigit(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_X))
^~~~