From patchwork Mon Aug 4 18:34:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 4673101 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D3F12C0338 for ; Mon, 4 Aug 2014 18:40:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F1022013D for ; Mon, 4 Aug 2014 18:40:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3681320136 for ; Mon, 4 Aug 2014 18:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbaHDSkf (ORCPT ); Mon, 4 Aug 2014 14:40:35 -0400 Received: from mdfmta010.mxout.tbr.inty.net ([91.221.168.51]:36183 "EHLO smtp.demon.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751330AbaHDSkf (ORCPT ); Mon, 4 Aug 2014 14:40:35 -0400 Received: from smtp.demon.co.uk (unknown [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mdfmta010.tbr.inty.net (Postfix) with ESMTP id DA7D86F89A8 for ; Mon, 4 Aug 2014 17:58:38 +0100 (BST) Received: from mdfmta009.tbr.inty.net (unknown [127.0.0.1]) by mdfmta009.tbr.inty.net (Postfix) with ESMTP id 49718384084; Mon, 4 Aug 2014 17:56:20 +0100 (BST) Received: from mdfmta009.tbr.inty.net (unknown [127.0.0.1]) by mdfmta009.tbr.inty.net (Postfix) with ESMTP id 19181384081; Mon, 4 Aug 2014 17:56:20 +0100 (BST) Received: from [192.168.254.10] (unknown [80.176.147.220]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mdfmta009.tbr.inty.net (Postfix) with ESMTP; Mon, 4 Aug 2014 17:56:19 +0100 (BST) Message-ID: <53DFD236.8090309@ramsay1.demon.co.uk> Date: Mon, 04 Aug 2014 19:34:30 +0100 From: Ramsay Jones User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Christopher Li CC: Sparse Mailing-list Subject: [PATCH 03/10] don't call isdigit/tolower with a char argument X-MDF-HostID: 4 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This suppresses some "array subscript has type 'char'" warnings from gcc (version 4.8.3). (see also, commit cf5114a1) Signed-off-by: Ramsay Jones --- 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; }