From: Vincent Torri <vincent.torri@gmail.com>
To: musl@lists.openwall.com
Subject: [musl] Warnings in fnmatch implementation
Date: Sun, 2 May 2021 14:11:03 +0200 [thread overview]
Message-ID: <CAMq1adqqqgb7U+Gb3-ov6-fOgcpdVRGBW-_BinrwqRFGw34ZKw@mail.gmail.com> (raw)
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
next reply other threads:[~2021-05-02 15:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-02 12:11 Vincent Torri [this message]
2021-05-02 15:18 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMq1adqqqgb7U+Gb3-ov6-fOgcpdVRGBW-_BinrwqRFGw34ZKw@mail.gmail.com \
--to=vincent.torri@gmail.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).