|
|
Message-ID: <CAMq1adqqqgb7U+Gb3-ov6-fOgcpdVRGBW-_BinrwqRFGw34ZKw@mail.gmail.com>
Date: Sun, 2 May 2021 14:11:03 +0200
From: Vincent Torri <vincent.torri@...il.com>
To: musl@...ts.openwall.com
Subject: Warnings in fnmatch implementation
Hello
when compiling fnmatch.c, I have there following warnings :
fnmatch.c: In function 'str_next':
fnmatch.c:34:13: warning: comparison of integer expressions of
different signedness: 'char' and 'unsigned int' [-Wsign-compare]
34 | if (str[0] >= 128U) {
| ^~
fnmatch.c: In function 'pat_next':
fnmatch.c:87:13: warning: comparison of integer expressions of
different signedness: 'char' and 'unsigned int' [-Wsign-compare]
87 | if (pat[0] >= 128U) {
| ^~
fnmatch.c: In function 'match_bracket':
fnmatch.c:129:24: warning: comparison of integer expressions of
different signedness: 'unsigned int' and 'int' [-Wsign-compare]
129 | if ((unsigned)k-wc <= wc2-wc ||
| ^~
fnmatch.c:130:28: warning: comparison of integer expressions of
different signedness: 'unsigned int' and 'int' [-Wsign-compare]
130 | (unsigned)kfold-wc <= wc2-wc)
| ^~
fnmatch.c:150:10: warning: comparison of integer expressions of
different signedness: 'char' and 'unsigned int' [-Wsign-compare]
150 | if (*p < 128U) {
| ^
fnmatch.c: In function 'fnmatch_internal':
fnmatch.c:232:13: warning: comparison of integer expressions of
different signedness: 'char' and 'unsigned int' [-Wsign-compare]
232 | if (s[-1] < 128U || MB_CUR_MAX==1) s--;
| ^
All the 128U can be replaced by just 128, and (unsigned) by just (int)
Maybe it is worth fixing them
best regards
Vincent Torri
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.