public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Kamil Rytarowski <n54@gmx.com>
Cc: rdunlap@infradead.org, linux-kbuild@vger.kernel.org,
	yann.morin.1998@free.fr, yamada.masahiro@socionext.com,
	richard@nod.at
Subject: Re: [RESEND][PATCH v2] Fix ctype(3) usage in the kconfig code on NetBSD
Date: Wed, 17 May 2017 14:24:10 -0700	[thread overview]
Message-ID: <20170517142410.f3eae6733cad60fc06a21bd3@linux-foundation.org> (raw)
In-Reply-To: <20170517133353.2644-1-n54@gmx.com>

On Wed, 17 May 2017 15:33:53 +0200 Kamil Rytarowski <n54@gmx.com> wrote:

> The current code produces set of warnings on NetBSD-7.99.25 (GCC 4.8.5):
> 
> In file included from scripts/kconfig/zconf.tab.c:2576:0:
> scripts/kconfig/confdata.c: In function 'conf_expand_value':
> scripts/kconfig/confdata.c:97:3:
> warning: array subscript has type 'char' [-Wchar-subscripts]
>    while (isalnum(*src) || *src == '_')
>    ^
> scripts/kconfig/confdata.c: In function 'conf_set_sym_val':
> scripts/kconfig/confdata.c:155:4:
> warning: array subscript has type 'char' [-Wchar-subscripts]
>     for (p2 = p; *p2 && !isspace(*p2); p2++)
>     ^
> scripts/kconfig/confdata.c: In function 'tristate_print_symbol':
> scripts/kconfig/confdata.c:617:3:
> warning: array subscript has type 'char' [-Wchar-subscripts]
>    fprintf(fp, "%s%s=%c\n", CONFIG_, sym->name, (char)toupper(*value));
>    ^
> 
> Fix this portability issue by explicit casting to unsigned char.
> 
> ...
>
>  scripts/basic/fixdep.c               |  2 +-
>  scripts/kconfig/conf.c               |  6 +++---
>  scripts/kconfig/confdata.c           |  9 +++++----
>  scripts/kconfig/expr.c               |  3 ++-
>  scripts/kconfig/lxdialog/checklist.c |  3 ++-
>  scripts/kconfig/lxdialog/inputbox.c  |  3 ++-
>  scripts/kconfig/lxdialog/menubox.c   | 11 +++++++----
>  scripts/kconfig/lxdialog/util.c      |  5 +++--
>  scripts/kconfig/menu.c               |  4 ++--
>  scripts/kconfig/nconf.c              |  3 ++-
>  scripts/kconfig/nconf.gui.c          |  3 ++-
>  scripts/kconfig/symbol.c             |  8 ++++----
>  12 files changed, 35 insertions(+), 25 deletions(-)

This patch is irritating :(  The Linux manpage says

"These functions check whether c, which must have the value of an
unsigned char or EOF..."

so it's legit enough.

Apart from being ugly, it isn't very maintainable: people on Linux
systems will add new instances while not including the typecasts.

I wonder if there's anothing we can do in the Makefiles to suppress
that warning in scripts/ for netbsd systems?  ie, disable
-Wchar-subscripts in that case?


  reply	other threads:[~2017-05-17 21:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08  0:31 [PATCH] Fix ctype(3) usage in the kconfig code on NetBSD Kamil Rytarowski
2017-05-07 13:44 ` [PATCH v2] " Kamil Rytarowski
2017-05-07 13:59   ` Kamil Rytarowski
2017-05-08  0:04     ` Randy Dunlap
2017-05-08 23:52       ` Randy Dunlap
2017-05-17 13:13         ` Kamil Rytarowski
2017-05-17 13:33           ` [RESEND][PATCH " Kamil Rytarowski
2017-05-17 21:24             ` Andrew Morton [this message]
2017-05-18  1:03               ` Kamil Rytarowski

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=20170517142410.f3eae6733cad60fc06a21bd3@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=n54@gmx.com \
    --cc=rdunlap@infradead.org \
    --cc=richard@nod.at \
    --cc=yamada.masahiro@socionext.com \
    --cc=yann.morin.1998@free.fr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox