From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: patches@linaro.org, Cornelia Huck <cohuck@redhat.com>,
Alexander Graf <agraf@suse.de>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Kamil Rytarowski <kamil@netbsd.org>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH for-2.10] Use qemu_tolower() and qemu_toupper(), not tolower() and toupper()
Date: Thu, 20 Jul 2017 12:57:52 -0500 [thread overview]
Message-ID: <2ba1a0e2-3e15-189c-b66f-2128dfb61bad@redhat.com> (raw)
In-Reply-To: <1500568290-7966-1-git-send-email-peter.maydell@linaro.org>
[-- Attachment #1.1: Type: text/plain, Size: 895 bytes --]
On 07/20/2017 11:31 AM, Peter Maydell wrote:
> On NetBSD, where tolower() and toupper() are implemented using an
> array lookup, the compiler warns if you pass a plain 'char'
> to these functions:
>
> gdbstub.c:914:13: warning: array subscript has type 'char'
>
> This reflects the fact that toupper() and tolower() give
> undefined behaviour if they are passed a value that isn't
> a valid 'unsigned char' or EOF.
>
> We have qemu_tolower() and qemu_toupper() to avoid this problem;
> use them.
>
> (The use in scsi-generic.c does not trigger the warning because
> it passes a uint8_t; we switch it anyway, for consistency.)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-07-20 17:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 16:31 [Qemu-trivial] [PATCH for-2.10] Use qemu_tolower() and qemu_toupper(), not tolower() and toupper() Peter Maydell
2017-07-20 17:57 ` Eric Blake [this message]
2017-07-20 18:08 ` Christian Borntraeger
2017-07-20 18:26 ` Richard Henderson
2017-07-20 18:48 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2017-07-20 18:57 ` Richard Henderson
2017-07-20 19:04 ` Eric Blake
2017-07-20 19:14 ` Richard Henderson
2017-07-20 21:03 ` [Qemu-trivial] " Peter Maydell
2017-07-20 21:29 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2017-07-20 21:42 ` Peter Maydell
2017-07-20 23:58 ` [Qemu-trivial] " David Gibson
2017-07-21 10:23 ` [Qemu-trivial] [Qemu-devel] " Peter Maydell
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=2ba1a0e2-3e15-189c-b66f-2128dfb61bad@redhat.com \
--to=eblake@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=kamil@netbsd.org \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rth@twiddle.net \
/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;
as well as URLs for NNTP newsgroup(s).