From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement
Date: Tue, 25 Jan 2011 10:19:26 +0100 [thread overview]
Message-ID: <4D3E959E.9010803@redhat.com> (raw)
In-Reply-To: <m3zkqqyz16.fsf@blackfin.pond.sub.org>
On 01/24/11 18:47, Markus Armbruster wrote:
> Jes Sorensen <Jes.Sorensen@redhat.com> writes:
>>>>> qemu_toupper() - whats the problem?
>>> If a STRTOSZ_DEFSUFFIX_T? expands to a lower case character, its case
>>> will not match any input.
>>
>> Right, so one has to be careful when adding new suffix constants.
>
> Calls for a comment right next to the definition of the
> STRTOSZ_DEFSUFFIX_T*.
>
> I hate unstated restrictions that are hidden far away from the place
> where you can break them.
Well I am fine with a comment in the code.
>> However given that we already have all the likely to be used ones for
>> the near future, that isn't exactly a big issue.
>>
>> On the other hand forcing the use of the macros makes it less likely
>> that someone specifies an unsupported constant by hitting 'y' instead of
>> 't' or similar.
>
> Takes a combination of butterfingers, cross-eyedness, and near-total
> incompetence at basic smoke-testing.
Not really, all it takes is someone writing a piece of code, not
thinking about it, therefore only testing things where a suffix is
specified as an argument and it gets missed.
Jes
next prev parent reply other threads:[~2011-01-25 9:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 15:33 [Qemu-devel] [PATCH v4 0/4] strtosz() cleanups Jes.Sorensen
2011-01-24 15:33 ` [Qemu-devel] [PATCH 1/4] strtosz(): use unsigned char and switch to qemu_isspace() Jes.Sorensen
2011-01-24 16:10 ` Markus Armbruster
2011-01-24 16:11 ` Jes Sorensen
2011-01-24 16:40 ` Markus Armbruster
2011-01-24 15:33 ` [Qemu-devel] [PATCH 2/4] strtosz() use qemu_toupper() to simplify switch statement Jes.Sorensen
2011-01-24 15:33 ` [Qemu-devel] [PATCH 3/4] strtosz(): Fix name confusion in use of modf() Jes.Sorensen
2011-01-24 15:33 ` [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement Jes.Sorensen
2011-01-24 16:08 ` Markus Armbruster
2011-01-24 16:10 ` Jes Sorensen
2011-01-24 16:39 ` Markus Armbruster
2011-01-24 16:41 ` Jes Sorensen
2011-01-24 17:47 ` Markus Armbruster
2011-01-25 9:19 ` Jes Sorensen [this message]
2011-01-25 10:17 ` Markus Armbruster
2011-01-25 11:54 ` Jes Sorensen
2011-01-24 15:45 ` [Qemu-devel] Re: [PATCH v4 0/4] strtosz() cleanups Kevin Wolf
2011-01-24 17:28 ` Stefan Weil
2011-01-25 9:18 ` Jes Sorensen
2011-01-25 10:14 ` Markus Armbruster
2011-01-25 11:52 ` Jes Sorensen
2011-01-25 13:19 ` Markus Armbruster
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=4D3E959E.9010803@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.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 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).