All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Jeff Cody <jcody@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] block: Explicitly specify 'unsigned long long' for VHDX 64-bit constants
Date: Fri, 14 Mar 2014 19:16:46 +0100	[thread overview]
Message-ID: <5323478E.1080008@redhat.com> (raw)
In-Reply-To: <20140314174947.GW1346@redhat.com>

On 03/14/14 18:49, Richard W.M. Jones wrote:
> On Fri, Mar 14, 2014 at 06:27:07PM +0100, Laszlo Ersek wrote:
>> *Why* someone would want to use an integer constant with type
>> "uint_least64_t" is a separate matter. One example follows -- assume all
>> of the below:
>> - suppose you write portable C99 source code,
>> - hence you can't take uint64_t for granted,
>> - you want a constant that's otherwise small enough to be represented as
>> "int",
>> - but you want that constant to trigger the "usual arithmetic
>> conversions" (see 6.3.1.8) to evaluate expressions that the constant
>> participates in in at least 64 bits,
>> - you want the narrowest type that allows you to do this.
> 
> - You want the code to self-document its intentions.

I do.

> I don't think ULL does that because it requires people to know that
> ULL is at least 64 bits.

Oh. I see what you mean. This never crossed my mind (= people missing
the fact that unsigned long long can represent at least up to 2^64-1).

Laszlo

  reply	other threads:[~2014-03-14 18:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 10:50 [Qemu-devel] [PATCH] block: Explicitly specify 'unsigned long long' for VHDX 64-bit constants Jeff Cody
2014-03-14 15:25 ` Stefan Hajnoczi
2014-03-14 15:36 ` Richard W.M. Jones
2014-03-14 15:38   ` Peter Maydell
2014-03-14 15:57     ` Richard W.M. Jones
2014-03-14 16:26       ` Laszlo Ersek
2014-03-14 16:51         ` Richard W.M. Jones
2014-03-14 17:27           ` Laszlo Ersek
2014-03-14 17:49             ` Richard W.M. Jones
2014-03-14 18:16               ` Laszlo Ersek [this message]
2014-03-14 16:17   ` Laszlo Ersek
2014-03-14 16:26     ` Peter Maydell
2014-03-14 16:35       ` Laszlo Ersek
2014-03-14 16:36         ` Laszlo Ersek
2014-03-14 17:08         ` Peter Maydell
2014-03-14 17:42           ` Laszlo Ersek
2014-03-14 18:22             ` Peter Maydell
2014-03-14 18:49               ` Laszlo Ersek
2014-03-14 18:57                 ` Laszlo Ersek

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=5323478E.1080008@redhat.com \
    --to=lersek@redhat.com \
    --cc=agraf@suse.de \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=stefanha@redhat.com \
    /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.