From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Christopher Li <sparse@chrisli.org>
Cc: Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: [PATCH 03/10] don't call isdigit/tolower with a char argument
Date: Mon, 04 Aug 2014 19:34:30 +0100 [thread overview]
Message-ID: <53DFD236.8090309@ramsay1.demon.co.uk> (raw)
This suppresses some "array subscript has type 'char'" warnings from
gcc (version 4.8.3). (see also, commit cf5114a1)
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
expression.c | 2 +-
lib.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/expression.c b/expression.c
index 4353dbe..7293d47 100644
--- a/expression.c
+++ b/expression.c
@@ -240,7 +240,7 @@ static struct token *builtin_offsetof_expr(struct token *token,
static unsigned long long parse_num(const char *nptr, char **end)
{
- if (nptr[0] == '0' && tolower(nptr[1]) == 'b')
+ if (nptr[0] == '0' && tolower((unsigned char)nptr[1]) == 'b')
return strtoull(&nptr[2], end, 2);
return strtoull(nptr, end, 0);
}
diff --git a/lib.c b/lib.c
index 4e6fc81..9c7767e 100644
--- a/lib.c
+++ b/lib.c
@@ -281,7 +281,7 @@ static char **handle_switch_D(char *arg, char **next)
const char *name = arg + 1;
const char *value = "1";
- if (!*name || isspace(*name))
+ if (!*name || isspace((unsigned char)*name))
die("argument to `-D' is missing");
for (;;) {
@@ -699,7 +699,7 @@ static char **handle_param(char *arg, char **next)
/* For now just skip any '--param=*' or '--param *' */
if (*arg == '\0') {
value = *++next;
- } else if (isspace(*arg) || *arg == '=') {
+ } else if (isspace((unsigned char)*arg) || *arg == '=') {
value = ++arg;
}
--
2.0.0
reply other threads:[~2014-08-04 18:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=53DFD236.8090309@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.